Files
Roman ChojnackiandClaude Opus 5.5 dffcce22d5 CSS: Reaktor's own engine replaces libcss, and a pass of simplifications
core/css/css.c reads the stylesheets once into typed values and cascades
them as CSS does: !important, then specificity, then source order. It takes
var(), color-mix(in srgb, ...), em and rem, calc() over pixels, the @media
features Reaktor answers, @import at the top of a sheet, :not(), :enabled,
attribute selectors read as classes, descendant and child combinators, and
escapes. Rules are bucketed by the last compound of their selector, so a
query checks only the rules that could match. cssflat.c, LCUI's libcss and
yutil, and the lcui submodule go.

Screenshots of every showcase tab, notepad and simple, light and dark, with
normal and more contrast, are byte-identical to the libcss build, with
Water.css and with Simple.css; --a11y-dump differs only in the a11y struct's
size. Three values change to what CSS says: an unset background is
transparent black, an unset border color is the text's, and Simple.css's
:enabled:hover no longer reaches a disabled button. Against libcss, loading
the sheets takes 0.35 ms instead of 1.24 and a first query 0.32 us instead
of 4.4. csstest covers the cascade, values, @media and hostile sheets: import
loops and fan-out, var() that grows or expands too often, deep calc(), a sheet
left open, a huge file. 200,000 mutated sheets ran clean under AddressSanitizer.

Simplifications: dead state (redraw_always, sw_noaa, the hover-gap pin, a
muted note, an overwritten slider range, the font-baking blocks of the SDL
renderer, the a11y change index); REAKTOR_LAY_FILL for FILL_X | FILL_Y; one
helper each for flag parsing, capture runs, timings, paths from the working
directory, array growth, focus moves, tooltips, button presses, a11y slot
probes, UIA fragments and test strings; launchtest's notef() and last_node();
the output folder set once in CMake and a write-if-changed function; one test
list, tools/ci/tests.txt, for every workflow, so basetest and imagetest run.

The showcase drops its relaunch button, an ask() button is as wide as its
label, and build.sh takes a bare target. The docs follow, and PERFORMANCE.md
and the chart carry a new pass of all seven benchmark arms on one machine.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 02:37:13 +02:00

49 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
out="$root/build"
target=""
buildtype="Release"
while [ $# -gt 0 ]; do
case "$1" in
--target|-t)
shift
[ $# -gt 0 ] || { echo "build.sh: --target needs a name" >&2; exit 2; }
target="$1" ;;
--debug) buildtype="Debug" ;;
--release) buildtype="Release" ;;
--help|-h) echo "usage: build.sh [NAME | --target NAME] [--debug] [-- CMAKE_ARGS]"; exit 0 ;;
--) shift; break ;;
-*) echo "build.sh: unknown argument: $1 (try --help)" >&2; exit 2 ;;
*) target="$1" ;;
esac
shift
done
command -v cmake >/dev/null 2>&1 || {
echo "build.sh: cmake not found on PATH" >&2; exit 1; }
if [ ! -f "$root/external/SDL/CMakeLists.txt" ]; then
echo "build.sh: submodules missing - run: git submodule update --init --recursive" >&2
exit 1
fi
if command -v ninja >/dev/null 2>&1; then
set -- -G Ninja "$@"
fi
ncpu=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)
cmake -S "$root" -B "$out" -DCMAKE_BUILD_TYPE="$buildtype" "$@"
if [ -n "$target" ]; then
cmake --build "$out" --parallel "$ncpu" --target "$target"
echo
echo "built target: $target"
else
cmake --build "$out" --parallel "$ncpu"
echo
echo "built: $out/showcase (plus simple and notepad)"
fi