Repository navigation
test: a fizzy suite for claiming a transparent GPU window - #1
Merged
Merged
Conversation
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
marked this pull request as ready for review
October 9, 2026 18:08
This was referenced 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-fizzystep builds SDL_test and runs it: fizzyedit/sdl_zig#1.What it asserts
test/testautomation_fizzy_gpu.c, suiteFizzyGPU, for each of themetalandvulkanGPU drivers:gpu_claimTransparentWindow{Metal,Vulkan}: create anSDL_WINDOW_TRANSPARENTwindow, 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,vulkannames it, in which case it fails. CI passes--require-gpuwhere it knows the driver exists, so a broken driver load can't pass as a skip.test/testfizzy.cruns the fizzy suites the waytestautomation.cruns SDL's,--filter,--seedand--listincluded. It isn't namedtestautomation*.c, becausetest/CMakeLists.txtglobs those into testautomation and would get a secondmain(). The suite file itself does match the glob, so a CMake build compiles it into testautomation, unreferenced. I checked it compiles clean withzig 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
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).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.--require-gpu vulkan, both Vulkan tests pass, and Metal skips. This held on X11 under Xvfb and on Wayland under headless weston.macos-14,macos-15,macos-latest= macOS 26): each has an "Apple Paravirtual device", and both Metal tests pass there with--require-gpu metal.SDL_ClaimWindowForGPUDevicebefore any driver, so Vulkan would fail the same way, but I haven't run it.🤖 Generated with Claude Code