Skip to content

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Oct 16, 2025

This commit implements a headless graphics backend that renders to shared memory instead of physical display, enabling automated testing, CI/CD integration, and memory analysis without GUI dependencies.

  • POSIX shared memory architecture for IPC
  • Double buffering (front/back buffers)
  • Real-time FPS tracking and statistics
  • PNG screenshot capability with built-in encoder
  • Event queue with overflow detection (max 64 events)
  • Graceful shutdown command

Use cases:

  • Automated GUI testing in CI/CD pipelines
  • Memory leak detection with Valgrind/ASan
  • Performance benchmarking without display overhead
  • Screenshot generation for documentation
  • Regression testing with pixel-perfect comparison

Summary by cubic

Add a headless graphics backend that renders to POSIX shared memory, plus a control tool for screenshots, event injection, status, and graceful shutdown. This enables automated testing, CI checks, and performance/memory analysis without a GUI.

  • New Features

    • Shared-memory renderer with double buffering and damage-driven flips; tracks FPS and frame/ event stats.
    • headless-ctl: status, shot, mouse move/down/up, shutdown, monitor.
    • GitHub Actions workflow: builds headless demo, verifies PNG output, checks deterministic rendering, and runs Valgrind leak detection.
    • Build/Kconfig: BACKEND_HEADLESS and TOOL_HEADLESS_CTL; Makefile targets; docs/backends.md.
    • Safety: 64-event queue with overflow detection and coordinate validation; minor type-safety fixes in draw-common and font-edit.
  • Migration

    • Enable: make defconfig; use setconfig.py to set BACKEND_HEADLESS=y and TOOL_HEADLESS_CTL=y; make.
    • Run: start demo-headless, then use headless-ctl for status, screenshots, input, and shutdown.

@jserv jserv force-pushed the headless branch 3 times, most recently from a50cc03 to ef0037e Compare October 16, 2025 14:56
This commit implements a headless graphics backend that renders to
shared memory instead of physical display, enabling automated testing,
CI/CD integration, and memory analysis without GUI dependencies.
- POSIX shared memory architecture for IPC
- Double buffering (front/back buffers)
- Real-time FPS tracking and statistics
- PNG screenshot capability with built-in encoder
- Event queue with overflow detection (max 64 events)
- Graceful shutdown command

Use cases:
- Memory leak detection with Valgrind/ASan
- Performance benchmarking without display overhead
- Regression testing with pixel-perfect comparison
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 9 files

@jserv jserv merged commit 2a5734e into main Oct 16, 2025
9 checks passed
@jserv jserv deleted the headless branch October 16, 2025 15:26
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.

2 participants