Files
breeze/mk/tests-benchmark.mk
waoziandClaude Opus 5.5 054a29f02c Remove raylib: run every host on Kryon and Ziran
Breeze builds and runs with no raylib anywhere, on Ziran 7fbc8152 and
Kryon b5a61b37, with plot, entity, apps, css and game2d pinned to that
Kryon, so the lock has one Kryon and no raylib package.

- Linux and Windows run on Kryon's SDL2 and Cairo desktop host; WebP
  decodes with the linked libwebp (KRYON_WEBP_LINKED).
- Android owns its NativeActivity loop on Kryon's android_runtime:
  Pixmap on the activity's surface, android_touch input and Android's
  typefaces, paced to the app's frame target. The CMake build drops
  breeze_raylib, GLES and the raylib link wraps, and links Kryon's fopen
  wrapper.
- The browser reaches Kryon's canvas modules directly.
- Audio is Ziran's std audio: its mixer, the SDL, AAudio and OpenSL ES
  sinks, the WAV, MP3 and Vorbis decoders and the audio package's Opus.
  The MP3 and Vorbis archives come from Ziran's own codec recipes. The
  browser keeps Kryon's Web Audio.
- Host modules choose the desktop host, Android, the canvas or, for
  native tests that select none, a headless host with no window, input
  or audio device. host_keys.zi and text_input_host.zi replace
  raylib_host.zi and raylib_text_input.zi; the log is one implementation,
  with logcat on Android and the C runtime's open flags on Windows.
- The Makefile, Click packaging, CI and release workflows build no raylib.
- Tests: radio, app log, asset files, DPI, legacy sessions, sync recovery
  and the Android JNI bridge run without raylib stubs; voice playback is
  a Ziran test of real Ogg Opus narration through Ziran's mixer. Tests
  that only exercised raylib internals are removed.
- AppsControllerSha256 is the controller built from Apps b96d9afe on
  this graph.

Local tests: Linux desktop window, Habits UI and the Ziran and native
tests above pass on a private Xvfb; the Android debug APK runs on a
Pixel 4a; the Windows package runs under Wine on a private Xvfb.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 13:16:23 -03:00

71 lines
3.8 KiB
Makefile

# The desktop benchmark (tests/desktop_benchmark.zi), which measures the Linux
# desktop build the same way before and after a change of desktop host. Its
# runtime scenario needs an executable built with the test driver:
#
# build-queue -- make native KRYON_TEST_DRIVER=1
# build-queue -- make desktop-benchmark BENCHMARK_LABEL=before
# build-queue -- make desktop-benchmark-build BENCHMARK_LABEL=before
#
# Results go to build/desktop-benchmark/LABEL/ as Markdown and TSV.
DESKTOP_BENCHMARK_DIR := $(BUILD_DIR)/desktop-benchmark
DESKTOP_BENCHMARK := $(DESKTOP_BENCHMARK_DIR)/desktop-benchmark
DESKTOP_BENCHMARK_SOURCES := $(wildcard tests/desktop_benchmark*.zi) \
$(KRYON_DIR)/src/backend/test_driver_client.zi
BENCHMARK_RUNS ?= 5
BENCHMARK_LABEL ?= current
BENCHMARK_OUT := $(abspath $(DESKTOP_BENCHMARK_DIR)/$(BENCHMARK_LABEL))
$(DESKTOP_BENCHMARK): $(DESKTOP_BENCHMARK_SOURCES) $(ZIRAN_BIN) $(SQLITE_AMALGAMATION_C)
rm -rf $(DESKTOP_BENCHMARK_DIR)/c
mkdir -p $(DESKTOP_BENCHMARK_DIR)/c
$(ZIRAN_BIN) build --target=c --root tests --module-path $(KRYON_DIR)/src/backend \
--module-path $(ZIRAN_DIR)/std -o $(DESKTOP_BENCHMARK_DIR)/c tests/desktop_benchmark.zi
$(CC) -O1 -w -c -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
$(SQLITE_AMALGAMATION_C) -o $(DESKTOP_BENCHMARK_DIR)/sqlite3.o
$(CC) -O2 -I$(ZIRAN_DIR)/include -I$(DESKTOP_BENCHMARK_DIR)/c \
$$(find $(DESKTOP_BENCHMARK_DIR)/c -name '*.c' | LC_ALL=C sort) \
$(DESKTOP_BENCHMARK_DIR)/sqlite3.o -lm -o $@
.PHONY: desktop-benchmark-tool desktop-benchmark desktop-benchmark-build
desktop-benchmark-tool: $(DESKTOP_BENCHMARK)
desktop-benchmark: $(DESKTOP_BENCHMARK)
@test -x $(TARGET) || { echo "Build the app first: KRYON_TEST_DRIVER=1 make native" >&2; exit 1; }
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
-u SESSION_MANAGER -u GDK_DISPLAY YUE_DESKTOP_RECOVERY=0 \
$(DESKTOP_BENCHMARK) run $(abspath $(TARGET)) $(CURDIR) $(BENCHMARK_OUT) $(BENCHMARK_RUNS)
desktop-benchmark-build: $(DESKTOP_BENCHMARK)
$(DESKTOP_BENCHMARK) build $(CURDIR) $(BENCHMARK_OUT) $(BENCHMARK_RUNS)
# The Linux desktop window as seen and pointed at (tests/desktop_window_test.zi):
# the navigation rail drawn at the window's edge, the whole window painted at
# its opening and maximized sizes, and a real pointer click landing on the
# drawn rail button. Needs Xvfb, xdotool, xwd and ImageMagick's convert.
#
# build-queue -- make desktop-window-test WINDOW_TEST_BINARY=path/to/breeze
DESKTOP_WINDOW_TEST := $(DESKTOP_BENCHMARK_DIR)/desktop-window-test
WINDOW_TEST_BINARY ?= $(TARGET)
$(DESKTOP_WINDOW_TEST): tests/desktop_window_test.zi tests/desktop_benchmark_session.zi \
tests/desktop_benchmark_profile.zi $(KRYON_DIR)/src/backend/test_driver_client.zi \
$(ZIRAN_BIN) $(SQLITE_AMALGAMATION_C)
rm -rf $(DESKTOP_BENCHMARK_DIR)/window-c
mkdir -p $(DESKTOP_BENCHMARK_DIR)/window-c
$(ZIRAN_BIN) build --target=c --root tests --module-path $(KRYON_DIR)/src/backend \
--module-path $(ZIRAN_DIR)/std -o $(DESKTOP_BENCHMARK_DIR)/window-c tests/desktop_window_test.zi
$(CC) -O1 -w -c -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
$(SQLITE_AMALGAMATION_C) -o $(DESKTOP_BENCHMARK_DIR)/window-sqlite3.o
$(CC) -O2 -I$(ZIRAN_DIR)/include -I$(DESKTOP_BENCHMARK_DIR)/window-c \
$$(find $(DESKTOP_BENCHMARK_DIR)/window-c -name '*.c' | LC_ALL=C sort) \
$(DESKTOP_BENCHMARK_DIR)/window-sqlite3.o -lm -o $@
.PHONY: desktop-window-test
desktop-window-test: $(DESKTOP_WINDOW_TEST)
@test -x $(WINDOW_TEST_BINARY) || { echo "Build the app first: KRYON_TEST_DRIVER=1 make native" >&2; exit 1; }
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
-u SESSION_MANAGER -u GDK_DISPLAY YUE_DESKTOP_RECOVERY=0 \
$(DESKTOP_WINDOW_TEST) $(abspath $(WINDOW_TEST_BINARY)) $(CURDIR) \
$(abspath $(DESKTOP_BENCHMARK_DIR)/window-test)