Skip to content

test: a fizzy suite for claiming a transparent GPU window - #1

Merged
foxnne merged 1 commit into
fizzy-3.4from
test/fizzy-gpu-suite
Oct 9, 2026
Merged

foxnne merged 1 commit into
fizzy-3.4from
test/fizzy-gpu-suite

Conversation

@foxnne

@foxnne foxnne commented Oct 9, 2026 •

Copy link
Copy Markdown

Part of fizzyedit/fizzy#280 (step A1). Test files only: no library code changes.

The first suite for fizzy's patches, on SDL's own test harness, for patch 1 ("GPU: let each driver decide whether it can claim a transparent window", a4b021c). fizzyedit/sdl_zig's new zig build test-fizzy step builds SDL_test and runs it: fizzyedit/sdl_zig#1.

What it asserts

test/testautomation_fizzy_gpu.c, suite FizzyGPU, for each of the metal and vulkan GPU drivers:

  • gpu_claimTransparentWindow{Metal,Vulkan}: create an SDL_WINDOW_TRANSPARENT window, check the flag stuck (a video driver that drops it would make the claim test nothing), SDL_ClaimWindowForGPUDevice() succeeds, then acquire a swapchain texture, clear it to premultiplied 50% red and submit.
  • gpu_claimOpaqueWindow{Metal,Vulkan}: the same with an opaque window, the control.

A test whose driver isn't available is skipped (TEST_SKIPPED), unless the runner's --require-gpu metal,vulkan names it, in which case it fails. CI passes --require-gpu where it knows the driver exists, so a broken driver load can't pass as a skip.

test/testfizzy.c runs the fizzy suites the way testautomation.c runs SDL's, --filter, --seed and --list included. It isn't named testautomation*.c, because test/CMakeLists.txt globs those into testautomation and would get a second main(). The suite file itself does match the glob, so a CMake build compiles it into testautomation, unreferenced. I checked it compiles clean with zig cc -Wall -Wextra -Wmissing-prototypes -Wmissing-variable-declarations -Wshadow, not with a CMake build. To go upstream with the patch, the suite would join testautomation's list instead.

Verified

  • fizzy-3.4, macOS 26.5 (Apple silicon, Metal), through sdl_zig's zig build test-fizzy: both Metal tests pass (15/15 asserts in the transparent one, swapchain 320x240), and both Vulkan tests skip (no Vulkan driver on macOS).
  • release-3.4.16 (fa2c02b), the same Mac: the transparent Metal test fails with Validate that the window was claimed, got error: The GPU API doesn't support transparent windows, the opaque control passes, and the run exits 1. So the suite fails on upstream, as Call SDL_SetVideoMode will make Lua fail in SDL 1.3 libsdl-org/SDL#280 requires.
  • Linux, Vulkan on lavapipe (llvmpipe, Mesa 26.0.8), in build: a test-fizzy step running fizzy's SDL patch suites sdl_zig#1's CI (Ubuntu 26.04 container): all four tests run with --require-gpu vulkan, both Vulkan tests pass, and Metal skips. This held on X11 under Xvfb and on Wayland under headless weston.
  • GitHub's hosted macOS runners (macos-14, macos-15, macos-latest = macOS 26): each has an "Apple Paravirtual device", and both Metal tests pass there with --require-gpu metal.
  • Fails on upstream: verified on Metal only. The refusal is in SDL_ClaimWindowForGPUDevice before any driver, so Vulkan would fail the same way, but I haven't run it.

🤖 Generated with Claude Code

The first of the suites for fizzy's patches, on SDL's own test harness.
testautomation_fizzy_gpu.c checks "GPU: let each driver decide whether it
can claim a transparent window": for the Metal and Vulkan drivers it
creates an SDL_WINDOW_TRANSPARENT window, checks the flag stuck, claims it
with SDL_ClaimWindowForGPUDevice(), clears it to a premultiplied 50% red
and presents it. An opaque claim with each driver is the control. A test
whose driver is unavailable is skipped, unless the runner's --require-gpu
names it.

testfizzy.c runs the fizzy suites the way testautomation runs SDL's
(--filter, --seed, --list). It is named outside testautomation*.c so the
CMake build's glob does not take a second main(); the suite itself is
compiled into testautomation there, unreferenced (checked with zig cc
-Wall -Wextra -Wmissing-prototypes -Wmissing-variable-declarations, not
with a CMake build).
fizzyedit/sdl_zig's `zig build test-fizzy` builds SDL_test and these.

On release-3.4.16 the transparent Metal claim fails ("The GPU API doesn't
support transparent windows"); on fizzy-3.4 all of it passes.

Part of fizzyedit/fizzy#280.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foxnne
foxnne marked this pull request as ready for review October 9, 2026 18:08
@foxnne
foxnne merged commit 4839ede into fizzy-3.4 Oct 9, 2026
foxnne added a commit to fizzyedit/fizzy that referenced this pull request Oct 9, 2026
…294)

Fixes #289. Part of #280 (steps A1, A2 and A4b landed on the forks).

Moves fizzy's `.sdl` pin to sdl_zig `fizzy-1.0.3+3.4.16-8` (SDL
`fizzy-3.4.16-8`). That brings two things:

**1. The forks carry tests now.** fizzyedit/SDL has fizzy's own suites
on SDL's test harness, one per patch, each failing without its patch.
fizzyedit/sdl_zig runs them with `zig build test-fizzy` in CI: Linux on
lavapipe under Xvfb and headless weston, and the hosted macOS runners,
which have a Metal device.
- fizzyedit/SDL#1 → `fizzy-3.4.16-6` (`4839ede`): the runner, plus patch
1's suite (transparent window claimed on Metal and Vulkan).
- fizzyedit/sdl_zig#1 → `fizzy-1.0.3+3.4.16-6` (`0f6a2a8`): the
`test-fizzy` step.
- fizzyedit/SDL#2 → `fizzy-3.4.16-8` (`a518aaf`), fizzyedit/sdl_zig#2 →
`fizzy-1.0.3+3.4.16-8` (`a02dda8`): patch 6's suite, Wayland frame
insets.
- **How:** it reads libwayland's request trace under headless weston, at
scale 1 and 2.
- **Checks:** geometry, input region, min/max sizes and published insets
while floating; zero insets when maximized or fullscreen; popup
anchoring.
  - **Result:** passes on the fork, and fails on upstream 3.4.16.
  - **Problems it found in patch 6:** five, listed in #280 (C2b).

**2. SDL patch 8: Wayland loads where libxkbcommon is older than 1.10**
(#289).
- **The bug:** built against 1.10+ headers (sdl_zig uses 1.13), SDL
required `xkb_keymap_mod_get_mask()`. On Ubuntu 24.04 (1.6) or Debian 12
(1.5) the whole Wayland driver reported itself unavailable, and fizzy
fell back to X11. Upstream `main` has the same problem.
- **The fix:** the symbol is now optional at runtime, and the masks fall
back to `xkb_keymap_mod_get_index()`, the path SDL already takes when
built against older headers. For standard keymaps both paths give the
same masks.
- **The proof:**
- [red](https://github.com/fizzyedit/sdl_zig/actions/runs/37968707700)
on `ubuntu:24.04` without the patch ("wayland not available");
- [green](https://github.com/fizzyedit/sdl_zig/actions/runs/37971005996)
on 24.04 and 26.04 with it, where a German keymap's Shift, Caps Lock and
AltGr levels come out right.
- **The PRs:** fizzyedit/SDL#3 → `fizzy-3.4.16-7` (`36dda37`);
fizzyedit/sdl_zig#3 → `fizzy-1.0.3+3.4.16-7` (`264af2a`).

`docs/DEPENDENCIES.md` records patch 8, the three suites, sdl_zig's step
and CI jobs, all six tags, and each patch's check at a rebase.

## Verified

On macOS (arm64), in a fresh workspace on `main`:

| Gate | Result |
|---|---|
| `zig build` | 43/43 steps |
| `zig build test` | 75/75 steps |
| `zig build test-integration` | 33/33 steps, 347/347 tests |
| `zig build check-web` | 16/16 steps |
| `zig build test-sdk-version` | 12/12 steps |
| `zig build -Dtarget=x86_64-linux-gnu` | 54/54 steps (builds the
patched Wayland file) |

Not verified: a fizzy binary running on a real Ubuntu 24.04 Wayland
desktop. The evidence is the fork suite in CI containers, built from the
same sdl_zig. The SDK fingerprint doesn't move, since plugins never link
SDL.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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