Files
Roman ChojnackiandClaude Opus 5.5 be028beec5 Docs: tighter, and current with master
Same facts in fewer words across README, CLAUDE.md, CONTRIBUTING,
DOCUMENTATION, FAQ, DEMO and NOTICE, and the claims that had drifted from
the code brought back in line:

- CI runs eleven console tests from tools/ci/tests.txt, plus the scripted
  uitest, skiptest and damagetest; the Tests table lists the last two.
- Linux ARMv7 and RISC-V build on every pull request, emulated and allowed
  to fail, not only on master.
- CONTRIBUTING runs the tests from tools/ci/tests.txt instead of an old list.
- The showcase is about 4,600 lines and notepad about 410.
- The shared library also ships as -macos-universal.
- SDL's GPU API is built only with REAKTOR_SHADERS.
- The architecture list names core/sdl and damage drawing.
- CLAUDE.md: --shot also hides partial redraws; damagetest catches them.
- PLAN.md is marked finished, with what has changed since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:32:35 +01:00

5.8 KiB

Reaktor

C99. Widgets are declared; the look comes from CSS read at runtime.

Build and run

./build.sh [target] (./build.ps1 on Windows, which finds cmake; it is not on PATH). Targets: showcase, notepad, simple, bench, the tests in tests/, and libreaktor. -Arch x86|arm64 builds into build-<arch>; ARM64 is checked only by CI.

CMake options pass through: ./build.ps1 -DREAKTOR_A11Y=OFF, ./build.sh -- -DREAKTOR_A11Y=OFF. The cache keeps them; pass =ON to switch back. Check build/CMakeCache.txt before measuring: REAKTOR_SHARED=ON left in build/ links every sample shared.

Shipping: tools/package.sh packs a release folder, tools/libreaktor-pkg.sh a system package (libreaktor static; with -s, libreaktor1, libreaktor-sdl3-0 and libreaktor-shared). A version tag such as 1.2.3 publishes through release.yml.

Verify against pixels, not source

Reasoning about what a dependency will draw has been wrong too often. Take the screenshot and diff the dump:

./build/showcase --tab 7 --theme dark --shot a.bmp --a11y-dump a.txt

The dump has a line per node with role, name, value, state and bounds, so a one-pixel move shows. Lines marked volatile (Diagnostics timings) differ every run.

Traps that have cost real time

  • A rule cannot resize a box the page sized. .box = { .h = N } locks CSS out of that axis; usually why a stylesheet "only changes the color".
  • core/ui/style_map.c is the only writer of nk_style. Anything set elsewhere is lost on the next theme change.
  • A box is placed one frame late and found by its name. A widget whose label changes every frame needs a stable .name.
  • Hover redraws only across a hot rectangle. Motion runs a frame only when it crosses a rectangle hot_push registered the frame before.
  • A percentage is not a length to core/css/css.c. width: 100% is dropped and a lower rule shows through. [type=range] reads as input.type-range.
  • Vertices snap to whole pixels. Sub-pixel corrections vanish; abutting rects can round apart into a seam.
  • SDL's software renderer redraws rectangles its own way, truncating position and size apart at fractional scales. nk_sdl_quad draws them from device pixels first.
  • A one-pixel stroke is two pixels. nk_stroke_rect casts to short and anti-aliasing splits it. Borders are reaktor_edge_round: a ring mask for corners, runs cut from its middle texels.
  • Rounded fills are masks. Fill anti-aliasing is off on the software renderer, so reaktor_render swaps each rounded fill for reaktor_fill_round, relinking the command list (it ends where a next reaches ctx->memory.allocated).
  • SDL draws when it flushes, not when it is asked. Its calls only queue, so without a GPU most of a frame is the flush the runtime makes before timing the present; the Diagnostics page and bench --no-vsync split them. Vsync sits in the present: a total matching the refresh rate measures it.
  • --shot never skips a frame. It and a capture force a whole draw, so a pixel diff cannot see what skipping an unchanged frame, or redrawing only what changed, breaks; tests/skiptest.c and tests/damagetest.c can. Skipping is the default; .draw_every_frame turns it off.
  • Text the atlas lacks is not Nuklear's. Strings with Japanese, Arabic and the like are measured and drawn by core/text/text.c through a custom command. mojibake 0.5.0 records byte_offset at a character's last byte.
  • Only Nuklear's active window gets input. Others carry a sticky NK_WINDOW_ROM. A layer that must not take input uses reaktor_layer_begin with HOLD_ALL; reaktor_layer_focus hands focus back.
  • A field's keys are its own. Edit state lives on the widget's window, so navigation asks app->editing before taking arrows, Home, End, Enter or Space. The runtime keeps Home and End, which would scroll the panel.
  • A field's value is not its buffer. nk_edit_string leaves bytes past the length; a length not from the field's own last frame reseeds it empty.
  • An empty edit has no text pointer. nk_str_get_const is NULL while nk_str_len_char is positive.
  • Web: a tap focuses the canvas. Only canceling the touch pointerdown stops it.
  • Web: SDL delivers events a frame late, so the page's own typing goes through SDL's queue to keep its order.
  • Web: a hidden page runs no frames. A background tab fires no requestAnimationFrame, so the canvas and a11y tree stay empty. Check document.visibilityState.
  • The shared library exports only tools/reaktor.map. A new public call goes in the map, or check-exports.sh fails; a struct an app sees that changes needs a new SOVERSION and check-abi.sh -u. OpenBSD installs no unversioned libreaktor.so.

House rules

  • Dependencies are submodules under external/, used as they ship. Never copy a value out of one or generate a header from one. The exception is REAKTOR_BUILTINS in CMakeLists.txt: Water.css's palettes and src/parts/, the seven Ionicons the widgets draw, the Aileron fonts, the mark and reaktor.css, compiled in byte for byte. SDL is built with core/sdl/no_dynapi.h; NOTICE.md says why.
  • Applications see only include/reaktor/; App is opaque. What a sample needs becomes a public call. MSVC treats implicit declarations as errors.
  • American English.
  • No environment variables: overrides are command-line flags the runtime strips from argv.
  • docs/DOCUMENTATION.md is the only manual; PERFORMANCE.md holds measured numbers only, with the machine named.
  • An optional module is an interface library plus a _none twin, switched by REAKTOR_<NAME> (default ON). Off, pixels and --a11y-dump must not change beyond what the module draws. Localization and text shaping are separate modules.