E1-B: Linux drawing probe
History (2026-11-10). This probe builds only up to commit
d785cce8. Step 2 of openspec/changes/archive/2026-11-10-gles-removal-plan/design.md removed the effects bridgenative/wgpu-bridge(galaxy-wgpu-bridge), whichCargo.tomlandCargo.lockhere still name by path; the path no longer exists and no stub replaces it.benchmark-smithay.pydrives--effects-backend, an option of the compositor that was removed in the same step, so it no longer runs either. Check outd785cce8to build or run it. Nothing below was rewritten.
An independent experiment, not a renderer of Galaxy Shell. Its GPU transport and
WGSL pass now come from native/wgpu-bridge (galaxy-wgpu-bridge). It imports no
compositor state or product UI. The optional smithay-bridge binary adds the private
Wayland client. The product compositor had separate optional wgpu-effects hooks, and its
standard build kept GLES when this was written (history: the product has no GLES since
openspec/changes/archive/2026-11-10-gles-removal-plan/design.md, 2026-11-12; the GLES of this probe is wgpu's GL backend of the
experiment only). The experiment's pinned lock
includes the native path dependency. The product-effect benchmark below uses the
compositor binary, independently of this drawing probe.
Pinned: wgpu 30.0.1 (Vulkan and GLES on Linux, Metal on macOS, WGSL), winit 0.30.13 (Wayland on Linux, AppKit on macOS), Rust 1.93. The lockfile is committed. The macOS target is described in "macOS target" below; Windows is not implemented here.
Run
First prepare the checkout with the normal project preparer. Then, from the checkout, run:
python3 experiments/portability-probe/run-linux.py \
--output /absolute/local/artifacts/e1-b.json
The output must be a new file outside the checkout. Prefer
~/.codex/artifacts/qa/galaxy-shell/YYYY-MM-DD-e1/. Reports stay local; no upload.
The runner builds this independent workspace in release mode, starts a fresh
headless nested QA run, launches the probe through nested-qa.py launch, waits
for its JSON, saves it and stops only that run in finally. An existing QA run
is refused. No real profile, parent display, accessibility or session bus is
passed to the client. The binary refuses to start without the private QA
identity and socket. This guard prevents accidental use, not hostile code.
Defaults: 60 measured seconds at 1280x720, FIFO presentation. The runner waits
for the confirmed geometry and PID of its own synthetic window, then uses a
Super+right-button drag in the nested compositor to resize it. The probe uses
no client decorations. Measurement starts only after a configure at 1280x720;
a 30-second setup timeout or any later size change fails the run. Warmup frames,
CPU time and timestamp samples are excluded. The initial 952x568 reports are
historical and are not comparable to this workload.
--seconds 5 is a smoke run. --reduced-motion keeps progress at zero rather
than animating; it is an explicit preference for this standalone experiment,
not automatic desktop preference discovery. The shader is a manual translation
of native/smithay/src/black_hole.frag. Its input is a generated premultiplied
RGBA checker texture with a transparent border. No pixels are captured or read
back; only two 64-bit timestamps are copied back for each sampled frame. Premultiplied surface alpha is required; CPU adapters are refused.
What the report proves
- Explicit Vulkan or GLES adapter selection, surface capabilities, configuration, shader and pipeline validation, texture upload, submitted frames and skipped acquisitions.
- Interval p50/p95/p99 between successful client submissions (not GPU or actual display timing), CPU time from procfs and sampled RSS. Instrumentation itself is included in CPU time. The first frame has no interval sample.
- Explicit upload sizes: one 256x256 RGBA texture and 16 uniform bytes per frame. These do not measure copies inside wgpu, the driver or the compositor.
- Adapter identity is normalized; no user, host, monitor, adapter name, title of another window or absolute private path is written in the JSON.
- Render-pass GPU timestamps (ms, p50/p95/p99) when
TIMESTAMP_QUERYis supported. A three-slot asynchronous readback ring bounds memory and does not wait on the GPU per frame. A bounded final drain collects pending samples. The report includes sample counts, skipped samples and 16 readback bytes per sample. Timestamp errors fail the run; unsupported hardware reports unavailable. This timing excludes uploads, queue wait, query resolve, compositor and display.
Schema 3 also collects wp_presentation feedback on winit's existing Wayland
connection, through a separate event queue. One request precedes each measured
surface commit. Presented, discarded, pending and throttled requests stay
separate. Request-to-completion latency is computed only for CLOCK_MONOTONIC;
intervals come from compositor timestamps, not client submission estimates.
The queue bounds outstanding requests at 256. Pending feedback at termination
is reported as pending, never fabricated as presented or discarded.
The protocol is advertised only by single-output headless QA. Its timestamp
is taken after the offscreen renderer's glFinish, for surfaces actually
included in the render result. Refresh is unknown and all protocol flags are
zero: no physical scanout, vblank, hardware clock or zero-copy claim. Visible
nested and DRM backends do not advertise it. Physical displayed/dropped frames
and internal copy counts remain unavailable.
Compare with GLES
python3 experiments/portability-probe/compare-linux.py \
--output /absolute/local/artifacts/e1-b-comparison.json
Four sequential 60-second runs use ABBA order: Vulkan, GLES, GLES, Vulkan.
Both use the same WGSL, texture, dimensions, Rgba8UnormSrgb, FIFO, instrumentation
and opaque surface. The selected backend is strict, without fallback.
The aggregate includes every run and the median of two per-run percentiles,
not pooled percentiles or a statistical-significance claim. GPU times stay
unavailable if that backend lacks timestamp queries. Process CPU/RSS exclude
the compositor and other desktop processes.
Opaque mode is explicit (run-linux.py --backend gles --opaque): wgpu-hal
30.0.1 GLES advertises only CompositeAlphaMode::Opaque in gles/adapter.rs.
Default runs still require premultiplied transparency and refuse GLES rather
than silently relaxing that E1 requirement. Therefore the comparison does
not validate transparent UI portability. It compares two backends of wgpu,
not wgpu against the native Smithay GLES renderer. Matching vendor ids and
normalized adapter kinds are recorded; GLES device id may be unavailable.
Alpha capability and successful submission do not prove visual equivalence, direct DRM, multi-GPU, external-window interop or E1-A/E1-C. No pixel capture or visual-equivalence test is performed.
Checks
This is a separate Cargo workspace. Its formatting and Clippy commands need the same versioned toolchain bin directory as the product preparer; they do not use the Smithay manifest or shared target:
PATH=/usr/lib/rust-1.93/bin:$PATH cargo fmt --manifest-path experiments/portability-probe/Cargo.toml --check
PATH=/usr/lib/rust-1.93/bin:$PATH cargo test --locked --manifest-path experiments/portability-probe/Cargo.toml
PATH=/usr/lib/rust-1.93/bin:$PATH cargo clippy --locked --manifest-path experiments/portability-probe/Cargo.toml --all-targets -- -D warnings
The comparison aggregation also has focused checks:
python3 -m unittest discover -s experiments/portability-probe -p 'test_*.py'
Official API references used: wgpu 30.0.1, instance options, render pipeline. The Context CLI was unavailable; APIs were checked against official docs and the pinned crate sources downloaded by Cargo.
Timestamp APIs: pass writes, timestamp period. Schema 2 reports contain the reference size and optional GPU timing object; schema 1 artifacts remain preserved as historical evidence.
Presentation and interoperability references: Smithay 0.7.0 presentation, Wayland client 0.31.15 FFI, wgpu-hal GLES capabilities source.
Linux dma-buf bridge
run-bridge-linux.py --output /absolute/local/artifacts/bridge.json runs a
separate, optional binary in the same private nested isolation. It renders the
shared WGSL black-hole effect from progress 0 through 1 using a synthetic checker texture,
copies the optimal Vulkan texture into an exportable linear Vulkan buffer on the
GPU, exports its dma-buf and imports/renders it through Smithay's GlesRenderer.
It never reads pixels back or imports live application buffers.
The EGL and Vulkan adapters must match by DRM render-node major/minor. This prototype requires DMA_BUF export and foreign queue ownership. It negotiates ABGR8888/Rgba8Unorm or ARGB8888/Bgra8Unorm against GLES import support and Vulkan render-attachment/copy-source usages, preferring explicit linear over implicit modifiers. Both candidates retain alpha. No tiled, multiplane, opaque or sRGB format is reinterpreted as one of these packed layouts. It runs 1200 frames through one shared allocation. Vulkan releases ownership to FOREIGN and signals an exportable binary semaphore. Its SYNC_FD payload is imported into EGL and waited on by a server-side wait. The GLES frame exports a native fence that Vulkan imports temporarily into a binary semaphore; the acquire waits on it before subsequent COPY_DST work. Both directions require support checked on the matched device. A SYNC_FD export of -1 is treated as already signaled, never passed to EGL as a request to create a new fence.
Transfers reuse six fixed slots, each containing one command pool, command buffer, binary semaphore and fence. Before any frame writes or submissions, admission checks completion of both slots needed by that frame. Busy returns immediately without changing GPU resources or ownership. Reset/reuse only follows successful admission; a busy slot encountered during submission is an invariant failure. SYNC_FD exports detach the semaphore payload; temporary imports are restored after their queue wait completes. A nonblocking wgpu poll retires completed submissions. One terminal fence wait, followed by wgpu retirement polling, precedes destruction.
The offscreen runner retries busy admission on a 1ms timer, with a 5-second no-progress deadline. That timer uses sleep only in the private runner; integrating this API into the compositor requires scheduling a callback on its event loop. There are no CPU fence waits for slot recycling. This does not assert zero driver stalls or stable total RSS. The six-slot bound covers explicit synchronization objects, not every allocation in the driver or process. Errors exit the private client without Rust drops of potentially in-flight storage. The 1280x720 handoff copies 3686400 bytes on the GPU per frame, with no explicit CPU pixel copy; the synthetic input upload is separately reported.
On the tested GPU, EGL exposed only the implicit modifier and Vulkan exposed no compatible image modifier. Direct linear-image export also reported unsupported. The packed buffer path succeeded, but is a device-specific proof, not a portable modifier-negotiation solution. Visual/color/alpha parity, physical scanout, multi-GPU, nonblocking scheduling and integration into the live scene remain pending. The offscreen target has no visual assertion. Schema 7 additionally submits the exported content to a normal Wayland window in the private headless compositor; that proves scene consumption, not physical presentation or visual parity.
Validate this optional binary with cargo test and cargo clippy commands above
adding --features smithay-bridge (before -- -D warnings for Clippy).
API sources: Smithay ImportDma,
wgpu HAL buffer import.
Schema 6 bridge reports require a recognized negotiated format/modifier and 1200 frames, six slots, 2400 submissions, 2394
reuses, both SYNC_FD directions, zero backpressure CPU fence waits, and a valid
count of deferred frame attempts. The private GPU run completed 1200 frames with
784 busy deferrals and no slot-recycling fence waits. Local evidence:
wgpu-smithay-nonblocking-1200.json. Previous schemas remain historical.
Seven Rust tests and five Python tests cover existing statistics and report
acceptance; actual admission/recycling is exercised by the private GPU run.
Vulkan validation layers remain unavailable. Real compositor scheduling, modifier
negotiation, multi-GPU, physical presentation and visual parity remain pending.
API references: SYNC_FD temporary import, pending-signal export, EGLFence server wait. Context remains unavailable; Vulkan's official reference and the exact downloaded Smithay 0.7.0/wgpu 30.0.1 crate sources were used for this step.
Recycling reference: command-pool reset requires completed commands, SYNC_FD ownership.
Negotiation evidence: wgpu-smithay-negotiated-1200.json selected
Abgr8888/Rgba8Unorm with implicit modifier on this GPU, completing 1200 frames
with 734 deferrals. Explicit linear and BGRA selection/refusals are covered by
synthetic policy tests; they have not been exercised on a second GPU. Implicit
layout remains device-specific and does not assert portable image modifier
negotiation or visual parity. The buffer export capability is queried before
selection and checked again before allocation. The original GPU report was
rejected because external Debug formatting did not match stable schema labels;
labels were made explicit and the GPU run was repeated successfully.
Format API: adapter format features. Context is unavailable; the pinned official crate sources were checked.
Static scene delivery (schema 7, historical)
After 1200 offscreen frames, the final content is left at progress 0.5, with the 0-to-1 effect range exercised earlier. A terminal ownership release and CPU fence completion precede submission as a linux-dmabuf v3 wl_buffer on an ordinary xdg-shell window. The nested compositor must import it and confirm 60 presentation feedbacks. The client detaches and waits for wl_buffer.release before destroying backing storage. Each protocol wait has a 5s deadline. The Wayland socket remains the private QA socket; there is no active-session connection or pixel readback.
Schema 7 requires 60 scene presentations and buffer release in addition to the
offscreen invariants. There are two terminal Vulkan fence waits: the offscreen
cycle and the additional one-way scene delivery. Scene request-to-feedback timing
is headless GL completion, not input latency or physical scanout. The static
buffer is presented repeatedly; animated real-window effects are not implemented.
Evidence: wgpu-smithay-scene-60-final.json. Earlier scene reports remain history.
Protocols were checked against pinned wayland-protocols sources and the product's
existing dmabuf client tests; no native compositor dependency or IPC was added.
The independent workspace enables wayland-protocols' unstable protocol modules
for linux-dmabuf. Current overall progress: ../../docs/wgpu-integration-progress.md.
Updated scene delivery (schema 9)
The current runner keeps the 1200-frame offscreen proof, then updates 60 frames through two alternating Wayland dma-bufs. Before reuse it requires wl_buffer.release and exports the reservation's prior users as a sync_file (WRITE). Vulkan waits on that file during acquire. Its produced fence is imported into the reservation (WRITE) before attaching the buffer. This follows Linux's explicit/implicit sync UAPI and uses no per-frame CPU fence wait. The private protocol/event loop still paces on feedback; it is not the product's own renderer implementation.
All three shared pixel allocations are initialized by GPU fill, visibility barrier and a bounded completion wait before wgpu HAL import. This fixes the unsafe initialization precondition absent in historical reports. Two terminal waits plus three one-time allocation initialization waits occur. Unsupported ioctl operations fail, with no unsynchronized fallback. Callback failure preserves the pixel owners until the client's fail-fast exit. Evidence: wgpu-smithay-continuous-final.json. A GLES reference regression after the shared effect refactor is saved locally as gles-effect-input-refactor-opaque.json. No pixels or test artifacts are committed.
Sources: kernel sync_file UAPI, wgpu HAL buffer initialization contract. Context is still unavailable; pinned crate sources and the official kernel docs were checked directly. Remaining work is tracked in docs/wgpu-integration-progress.md.
A regressão isolada de GLES sem --opaque recusou a superfície por falta do alpha
solicitado. GLES e Vulkan completaram depois a execução de 5 s com --opaque
(gles-effect-input-refactor-opaque.json e vulkan-effect-input-refactor-opaque.json).
Esses resultados não validam transparência nem constituem benchmark de paridade.
GLES input (schema 10)
The bridge now samples a GLES-composed source, not a CPU-uploaded checker. GLES renders premultiplied synthetic rectangles into a shared linear buffer supporting COPY_SRC as well as COPY_DST. A native EGL fence is temporarily imported by Vulkan; the acquire uses TRANSFER_READ. A GPU buffer-to-texture copy provides the effect's input; the output continues through the offscreen cycle and 60 updated scene frames. The source image itself is static and synthetic; no real window is sampled yet.
The exact combined external buffer usage is queried before allocation. Four pixel allocations are GPU-initialized; the input adds one bounded terminal wait (three total), with no per-frame CPU fence waits. Input copy size is 3686400 bytes, zero CPU pixel upload or readback; uniform uploads remain. The schema validator rejects missing/CPU-uploaded input evidence. Reference: wgpu-smithay-gles-input.json. 9 Rust tests and 7 Python tests passed, plus fmt and Clippy. This is not yet a product renderer or visual acceptance. See docs/wgpu-integration-progress.md.
Shared native implementation (schema 11)
GPU transport, format policy, sync-file UAPI and WGSL live in native/wgpu-bridge. The probe imports these modules instead of maintaining copies. DeviceContext uses the caller's actual EGL context, and negotiation now requires GLES render support as well as import and Vulkan COPY_SRC|COPY_DST export. Extent validates dynamic sizes/row pitch with a per-allocation bound. Queue provenance and serialization are explicit unsafe contracts; unfinished transfers retain backing owners on error instead of exiting a product process. See native/wgpu-bridge/README.md for limits.
Run the library's tests and Clippy explicitly with -p galaxy-wgpu-bridge using
this manifest; root probe tests do not execute dependency tests. Eight library
unit tests and three probe unit tests passed, plus seven Python report tests.
GPU evidence: wgpu-product-context-roundtrip.json (1200 offscreen and 60 updated
scene frames). The library is not yet wired into the compositor executable or
window-effect scheduler. Historical schemas refer to earlier implementations.
Product Smithay effect comparison
benchmark-smithay.py compares native GLES reference effects and the WGSL ports
in the same optional compositor binary, using owned private headless ABBA runs.
It collects whole-phase frame p95/p99, compositor CPU/PSS and available DRM fdinfo
engine/resident accounting. It does not use this experiment's wgpu GLES backend.
See the procedure and limits for preparation,
local-only artifacts, predeclared gates and measurements still unavailable.
macOS target (E1-B and E1-A, 2026-11-09)
The same binary builds on macOS with Metal on winit's AppKit backend. Cargo
splits the dependencies by target: Linux keeps Vulkan/GLES, Wayland and the
shared galaxy-wgpu-bridge (ash and Smithay are Linux only); macOS adds wgpu's
metal feature. On macOS the probe compiles the bridge's effect.rs and
gaussian.rs through #[path], so the black-hole pass and its WGSL are the
same sources, not a copy. The Linux path keeps its guard, its presentation
feedback and its procfs metrics.
python3 experiments/portability-probe/run-macos.py \
--output ~/.codex/artifacts/qa/galaxy-shell/YYYY-MM-DD-e1/e1-b-macos.json
The runner builds in release mode and runs the probe with a clean environment
(PATH, a temporary HOME, TMPDIR and XDG_*, and a private run id the
binary requires). It opens one borderless 1280x720 physical-pixel window on the
current desktop (640x360 points on a Retina display), at the always-on-top level
so it stays drawn, and without taking the keyboard focus. No pixels are captured.
Host facts (model, chip, macOS version, displays without names or serials) are
read before the run.
macOS differences, each visible in the report:
--backend metalis the default. Surface formatBgra8UnormSrgb: CAMetalLayer offers noRgba8UnormSrgb.- Transparency uses
PostMultiplied. wgpu-hal 30.0.1 lists onlyOpaqueandPostMultipliedfor Metal (metal/adapter.rs), andPostMultipliedonly sets the layeropaque=false(metal/surface.rs). The shader writes premultiplied color; how CoreAnimation interprets it was not checked visually. - GPU timestamps resolve in a later submission. Metal writes the
end-of-fragment counter only when the command buffer completes: a resolve in
the same command buffer read the slot's previous value (end before begin), and
one in the next command buffer read zero. Waiting for completion gave valid
samples, so each slot now resolves after
on_submitted_work_done, with no CPU wait. Each slot also has its own query set (Linux included). - CPU is
getrusageuser+system, RSS isproc_pidinfosampled per frame, andlate_intervals_over_24mscounts client intervals above 1.5x the 16 ms pacing target. Presentation timing is unavailable:wp_presentationis Wayland only.
preflight.cjs is E1-A: Node or Electron as Node, no GPU, no product imports,
a temporary directory with a space in its name and a clean child environment.
Set GALAXY_SHELL_E1_OPENCODE to an OpenCode binary (the locked 2.1.4 from
runtime/opencode-package) and GALAXY_SHELL_E1_ELECTRON to the Electron 45
main binary for the main-process inspector check:
ELECTRON_RUN_AS_NODE=1 "$GALAXY_SHELL_E1_ELECTRON" experiments/portability-probe/preflight.cjs > e1-a.json
Results are in openspec/changes/macos/design.md, section E1 no macOS. The Linux build of
these changes was not run on Linux: run the checks above and a run-linux.py
smoke there before relying on it.
E1-C windows on macOS (2026-11-09)
galaxy-window-probe (src/window_probe.rs, src/ax.rs) uses only public API:
Accessibility, CoreFoundation and CGWindowList (owner and bounds, never titles).
It runs as its own bundle, Galaxy Shell E1 Probe.app with bundle id
io.github.naaando.galaxyshell.e1probe, ad-hoc signed and launched by open, so the
grant never lands on the Terminal. The bundle process starts a target process (the
same binary, target mode, one winit window and a child dialog on request) and
controls only that target. Then it runs the same binary as a helper child and
ax_child.py (an unrelated /usr/bin/python3 through ctypes) against the same
target. run-windows-macos.py lists the steps in order: build, phase, swap,
outside and revoke. The owner grants Accessibility in System Settings between the
no-permission and granted phases; the runner never changes TCC except
tccutil reset for this bundle id. Reports go to a local folder outside the checkout.
On other systems the binary only prints an error.