The fb host (mmap of /dev/fb0 or a raw-file stand-in, xrgb8888/rgb565
dirty-rect conversion) served no user: raylib covers desktop
presentation, the Canvas2D backend covers native web, and TUI is the
remaining terminal story. Drop the --backend fb / --fb-device /
--fb-format surface; krb-run keeps the headless PNG/recording flow the
conformance tests drive.
The Aero widget style derives its glass tints from whichever palette is
active, so a 13th palette entry was redundant. Remove THEME_AERO (and
its ini mirrors, locale label and picker slot); the style now defaults
to Sky. Saved theme ids beyond the shrunken count normalize through the
existing out-of-range fallback.
The Runtime interface now covers every widget family go/kryui itself
exposes, not just the .kry whitelist: the positional controls
(GenericButton, TextButton, LocaleDropdown, VerticalSlider, CanvasGrid,
SelectableText, ShowUIToast(For)), the Props widgets (TextInputControl,
ReadonlyTextBox, TextArea, Radio, Spinbox, Combobox, LabelFrame,
Notebook, PanedView, Collapsible, ListBox, SourceView, TableView), the
dialogs, the canvas (BeginUICanvas/EndUICanvas), the Tk layout helpers
(BeginUIFrameBox, UIFramePack, UIGridCell, UIPlace), and theme control
(SetCurrentTheme/SetThemeDarkMode/SetThemeStyle with THEME_STYLE_*
constants under their C names).
k2g lowers .kry array declarations to Go slices at the use site
(state and local 'name: [N] const char*' references emit 'name[:]'),
accepts UICanvas literals like Props/Spec, and maps the canvas/Tk
handle types. The syntax gate now exercises the whole parity set and
still compiles the output against the real cgo runtime.
Honest remainder, noted in the matrix: DropdownEx's rich option
arrays, forward-goto-over-declarations, and C pointer/Texture2D
values stay outside what .kry can express.
Projects without an explicit frame hook got a bare ScreenName() call in
the generated main: no drawing frame and no viewport argument, which
did not compile against screens lowered as fn(Rectangle viewport).
Wrap the call in BeginDrawing/BeginUIFrame and pass the screen
rectangle, mirroring what hosts do around DrawAppScreen. The example
font helper is now included in kryon_project.c when the app block asks
for the examples font, and the examples link rule compiles
kryon_project.c alongside the module so the binaries actually contain
main.
cmd/aero_shot draws one frame of every themed control (titlebar, tabs,
buttons, field, dropdown, slider, toggle, checkbox, progress, radios,
spinbox, glass panel) under any palette, mode and style, captures it
through the armed pre-swap readback and writes a PNG with kryon's own
writer. make aero-shot builds it; make aero-shots renders the
palette/mode/style reference matrix into build/<platform>/shots.
Declarations no longer degrade to 'any': the declared type is split
from the initializer before translation, go_type skips leading
whitespace and normalizes 'char *' to 'char*', and array types
('[N] const char*', '[N] int') map to Go arrays. Composite-literal
initializers take the Go form 'var x = [N]T{...}'. goto and label
statements emit verbatim — 'name:' and 'goto name' are valid Go, and
a forward jump over declarations stays a loud compile error rather
than a silent TODO.
The shared frontend now classifies a bare 'name:' as KIR_STMT_LABEL
(previously the kind existed but was never produced; labels only
worked through the raw-text path).
Generated code may pass the C-shaped option list to Dropdown/TextLines
— a ';'-joined string, a []string, or a [N]string array — so array
declarations feed widgets directly; Dropdown also tolerates the C
option-count argument, which the Go side derives itself.
Plan 11 phase 2 deliverable: mmap /dev/fb0 (or --fb-device /$FB_DEVICE),
query its geometry and pixel layout, and blit each frame's kry_sw dirty
rect converted to the target format — 32-bit truecolor by bit offsets
or RGB565. Ctrl-C stops the loop.
The device may be a regular file: then geometry comes from --w/--h and
--fb-format (xrgb8888 or rgb565) and the raw pixels are written back,
which makes the conversion testable without console hardware. The code
is __linux__-guarded so the windows/macos krb-run builds stay green.
Combobox((ComboboxProps){...}) previously had no lowering, so the
KRB_CTRL_COMBOBOX kind could never appear in a cartridge. k2b now
parses the Props literal (positional or designated) and emits the
control; the cartridge runtime routes it to the dropdown renderer,
exactly mirroring the C widget, which forwards to DrawUIDropdown.
Option lists can now come from .kry string-array variables (state or
local 'name: [N] const char* = {...}'), registered as joined 'a;b;c'
lists and usable by both Combobox and Dropdown lowering, not just from
inline literals.
Grow go/kryui so every whitelisted .kry widget statement lowers and
compiles through k2g: new Props/Spec types (PictureProps,
UIParagraphSpec, BottomNav/TopNav/Toolbar), cgo wrappers (TextInRect,
Paragraph, TextLines, Bevel, IconTexture by icon type, Picture, Toggle,
Modal, TitleBar, nav bars), the raylib color palette and picture-fit
constants under their C names, and the matching Runtime methods
(including Row/Stack, Key, Fade, theme getters, optional-border Rect).
k2g lowers positional Props/Spec literals through a C field-order table,
maps Id to ID, converts int-typed bool Props fields, and resolves the
color/fit constants. The syntax gate now exercises every widget and
still compiles the generated Go against the real cgo runtime.
k2g now compiles real declarative apps, not just the smoke subset:
- '#extern "pkg.Fn"' lowers to a generated <Guard>Host interface with a
Set<Guard>Host setter; extern calls become host.Method(...) with numeric
argument conversions so int/long/float widening always compiles. The Kir
frontend keeps the quoted host symbol on KirFunction.extern_target.
- 'Name :: enum' lowers to untyped Go constants with C counter semantics
(explicit literal resets the counter; explicit expressions chain +1), and
bare member names rewrite to the qualified Go constant at every use site.
- switch bodies translate: case/default labels, including brace-open forms
and same-line bodies; Go auto-break replaces C fallthrough by design.
- C-style three-clause for headers ('for int i = 0; i < n; i++') become
Go for headers with typed initializers; Go-style headers pass through.
- 'guard cond' lowers to a plain if (the body is the exit path).
- Assignments lower as statements; '} else {' chains emit on one line.
- Extended C-to-Go type map (short/size_t/long long/unsigned variants,
char** slices, [N]T arrays, T* pointers, const stripping) removes the
any-fallback for real signatures.
- Output is flat: nested source trees no longer nest Go files into
separate packages; duplicate basenames are rejected.
go/kryui grows the widget surface declarative apps need: TabBar (real
DrawUITabBar cgo wrapper with plain string labels), Rect, RectGradientH,
Line, Progress, Checkbox, Dropdown and screen-size getters on the k2g
Runtime interface, plus DropdownLabels for ';' option lists.
tests/k2g_syntax_test.sh now covers the whole subset and keeps the
compile-against-the-real-runtime gate; the full suite passes.
A multi-line /* ... */ comment before a function silently dropped it from
the generated C: a line ending in the comment close tripped the trailing-
slash continuation rule and glued the comment onto the next function
header, whose name parse then found no leading identifier. Lines starting
with the comment open were likewise swallowed as lookahead continuations.
Strip C-style block comments in place as each line is read (string/char
literal aware, newlines preserved so spans stay honest, state carried
across lines for comments that span them).
Also fix the plain-#-comment catch-all, added recently, swallowing real
#module and #import directive lines - the k2ir test regressed to
'module main' with a missing header import. Directives now fall through
to their own branches.
DATA nodes now carry their initializer (ints in x, CSTRs via text),
and KrbAutoMount(img) binds them into malloc'd slots. krb-run and
krb-sdl both call it, so bound counters, checkbox defaults, and
TextField contents render identically with or without generated
host binds. Cross-engine 11/11 byte-identical; suites green,
goldens regenerated.
A top-level comment line fell through the TOP dispatch and was
treated as a declaration header, silently swallowing the following
state/app/frame blocks into a bogus construct (the screen then
compiled to zero nodes). #if/#else/#endif/#defined still pass through
the conditional-frame machinery.
KFA1 glyph advances are now 1/256-px fixed point ((int)(adv*scale*256
+0.5) at bake; single rounding at draw/measure, matching ui_text.c's
float path). Spec updated.
The instrumented title run exposed the real screen content: the title
is 'Choose Language' (locale key), not 'Language' — resolving the
width anomaly. The cartridge now uses the traced strings, sizes,
and positions ('Choose Language' fs24 phys(159,32), 'Language' fs16
(45,273), 'Next' fs12 (230,377)); per-mille scale verified in-binary
(scale=1125, scale_px(141)=159).
Native parity 5765 -> 5179/307200 (98.3%). The residual is the
classic last mile: every glyph edge sits one sub-pixel off between
an exact integer blit and GL quad rasterization — closing it means
emulating the GPU's quad fill/sample rule in kry_sw. Cross-engine
8/8 byte-identical (after rebuilding the stale SDL host); suites and
goldens green.
The instrumented ui_text.c run pinned the native tier facts: ui
scale 1.125 (title tier base=27px for a 24 logical size), advances
w=9/adv=10 for 'L' — and glyph offsetY of +6 where raw stbtt gives
-15. raylib rtext.c line 730 adds (int)(ascent*scale) to every
offsetY: glyph offsets are line-top-relative. k2b_atlas now applies
the same shift; per-glyph values match the app trace exactly
('L' off=(1,6), 'a' (0,10)).
kry_sw's UI scale is per-mille (1.125 isn't expressible in integer
percent) with the same (int)(px*s+0.5) rounding as ScaleUIPx; the
native harness threads KRB_EXACT_UI_SCALE. The language cartridge
is now authored in logical units.
Native parity: 6423 -> 5765/307200; glyph positions track the
native within ~1-2px per element. Remaining: fractional-advance
storage (raylib keeps float advanceX; the u16 truncation drifts
~0.5px/glyph) and the title's measured width, under investigation.
Cross-engine: 8/8 byte-identical, suites green, goldens updated.
Three fixes:
- stbtt_GetCodepointBitmapBox returns coordinates (x0,y0,x1,y1), not
width/height — the measurement pass used raw coordinates, computing
bogus buffer heights and silently clamping most glyphs away. This
was the real cause of the missing text with inbe's subset font and
the krb-sdl/krb-run cross-engine 'noise'.
- Atlas size collection now excludes SCROLL nodes (their font_size
field carries content height — a 1250px 'font tier' blew the
cartridge cap on scroll screens 21-24).
- Optional physical-scale plumbing: K2B_UI_SCALE bakes tiers at
physical sizes, krb.c passes font sizes through scale_px,
KRB_RUN_UI_SCALE sets the kry_sw UI scale, and the native harness
threads KRB_EXACT_UI_SCALE (default 1).
Cross-engine exactness restored: 8/8 screens byte-identical
kry_sw == SDL. Native parity holds at 6423/307200 (98.0%); the
remaining delta is the native app's effective font tier for the
title (measured advances imply a physical size above 24 at
480x640), to be pinned by instrumenting ui_text.c once rather
than sweeping scales.
Glyph pen advance now matches ui_text.c exactly:
(int)(advanceX*scale + 0.5f), applied to both draw and measure.
krb-sdl --png renders exactly one frame through the same
draw-then-readback path as the interactive loop, eliminating
frame-count nondeterminism for the exactness comparator.
stbtt_PackFontRange replaced with per-glyph
stbtt_GetCodepointBitmap at stbtt_ScaleForPixelHeight plus
stbtt_GetCodepointHMetrics-scaled advances — the exact calls raylib's
rtext.c LoadFontData(FONT_DEFAULT) makes — row-packed first-fit with
bounds clamps. With KRB_EXACT_FONT pointing at inbe's subset face the
language screen reaches 6133/307200 differing pixels (98.0%): the
residual is raylib's DrawTextEx quad-sampling at glyph edges, not the
raster itself.
Measured geometry and palette from the first real native capture:
white background, centered title y37, label y284, dropdown x44/y299/
w391/h48 with #FBFBFB fill and #D3D3D3 border, text-only Next at
y379. krb-run gains KRB_RUN_THEME_LIGHT for the light palette.
Pixel diff vs the C build: 307200/307200 -> 6282/307200 (98.0%).
The remaining delta is glyph antialiasing parity between the KFA1
stb-baked atlas and inbe's raylib font pipeline — the last known
gap to literal 0.
'name: [N] T = {' opens an initializer: the declaration emits without
a semicolon, item statements join without one, and the brace closes
as '};'. Fixes the stray '{;' that broke compiling generated code
for array initializers spanning PushUIInspectSource lines.
Third backend alongside k2c/k2b: k2g lowers a KirProgram to Go source
that drives a Go kryon runtime (the cgo surface binding app uses), so
Go-native apps can be written in .kry. One frontend, three backends —
kry -> kir -> {c, krb, go}.
v1 fully translates the declarative subset: state blocks (Go struct +
instance), app metadata (generated main loop), frames, widget/surface
calls (rt.-qualified), compound literals (Vector2/Rectangle/Color),
scalar casts, hex/float literals, and state-field references including
address-of for scroll offsets. Imperative constructs are best-effort;
unsupported ones are emitted as commented TODOs rather than miscompiled.
Usage: k2g [--no-main] [--pkg NAME] [--runtime IMPORT] --root DIR -o DIR file.kry ...
Smoke-tested by tests/k2g_syntax_test.sh in 'make test'.
New VM pieces: OP_MOD, and OP_NODE_SET (pops an i16 and patches a
node's x/y/w/h through a mutable node overlay allocated on first
use). TIME is now a first-class term in expressions. The k2b program
compiler was restructured around an ordered instruction stream
(updates, draws, guard/else brackets interleaved in source order) so
conditional assignments compile correctly — previously both branches
of an if always ran, last-write-wins. Updates accept full
term-or-term-arith-term right sides including % and TIME.
examples/26_inbe_whm_session.kry: the Wim Hof session as a cartridge —
TIME -> elapsed -> phase -> triangle wave -> animated ring radius via
AnimNode('ring0','w',&radius), breath counter with clamp, in/out
phase text. Verified across frames: t=0/600ms/5s produce the exact
expected phase, radius, and breath values. Eight exactness screens
byte-identical kry_sw == SDL.
TextFormat now compiles to bound TEXT nodes correctly: the dispatch
was missing entirely, and the value/x/y/font/color args sit one slot
over from plain Text. Habits screen: scrollable rows with completion
checkboxes, live 'Streak: %d days' counters bound to state, and
conditional status lines. Engine goldens refreshed (the file held a
pre-atlas hash). All six exactness screens byte-identical kry_sw ==
SDL.
KRB_FLAG_NAV buttons write a screen id to a state path on press
(cartridge-owned navigation; no host import). k2b compiles
NavButton(label, x, y, w, h, &state.screen, id). Screens are guarded
node ranges over one state field; examples/23_inbe_app.kry is Inner
Breeze as a single 6 MB cartridge — language, settings, and manual
screens with dropdowns, scroll, checkboxes, and the breath ring,
navigable end to end (verified: Next/Manual/Back transitions via
injected clicks). Scroll containers now draw a 1px outline instead
of a filled rect. All five exactness screens byte-identical
kry_sw == SDL.
Declarative port of inbe's settings/device tab: scroll container with
clamped wheel offset, language and orientation dropdowns, fullscreen
and keep-screen-on checkboxes, conditional hint rows via if/else.
k2b's Scroll() now parses ScaleUIPx content heights (atoi gave 0, so
the wheel clamp never engaged). Cross-engine exactness extended to
this screen: kry_sw == SDL byte-identical.
parse_term now returns consumed length (single-term guards like
'if (x == 0)' previously fell through to nothing while arithmetic
forms worked by accident). ButtonProps positional initializers
(label-first, Rectangle bounds) parse alongside the designated form.
Dropdown accepts an optional height argument.
examples/20_inbe_language.kry: a faithful declarative Inner Breeze
language-picker screen — title, bordered locale dropdown with five
options, if/else hint text, Next button — compiles to a cartridge
that renders complete in every engine with its embedded atlas.
Each side of an if comparison is now term or term arith term
(path or integer, + - * /), compiled to the VM stack machine:
if (a + 1 < b - 2) emits PUSH/PUSH/ADD, PUSH/PUSH/SUB, LT, JZ.
KRB_CTRL_DROPDOWN (kind 4) implemented end to end: the control record's
reserved options_off/option_count now carry consecutive NUL-terminated
option strings (k2b appends them without interning so they stay
contiguous; Dropdown(id,x,y,w,"a;b;c",&val)). Click toggles the popup,
clicking a row writes the selected index to the bound int and closes.
Loader initializes the open-dropdown slot to -1 (0 is a valid index).
New node type 13: bounded field drawing the mounted CSTR with a
blinking caret when focused (click to focus). Typed input flows through
the new optional KryBackend.text_key (codepoints, 0x08 backspace):
kry_sw queues via KrySwText (drained per frame by Advance), the raylib
surface backend maps GetCharPressed, SDL maps SDL_TEXTINPUT/BACKSPACE,
krb-web exports krb_web_text from keypress events. UTF-8 runes append
and strip correctly. k2b compiles TextField(x,y,w,h,&state.field).
Verified: click-focus, typing with backspace, and that unfocused
fields ignore keys.
SCROLL node (type 12): viewport bounds, content height in font_size,
mounted pixel offset at name_off. Children (parent = scroll index)
draw translated by -offset and clipped to the viewport; a new
optional KryBackend.wheel entry drives the offset when the pointer is
over the viewport, clamped to [0, content_h - h]. Implemented in
kry_sw (+KrySwWheel injection), the raylib surface backend, the null
and recorder backends; krb-sdl maps SDL_MOUSEWHEEL, krb-web exposes
krb_web_wheel from canvas wheel events. k2b compiles
Scroll(x, y, w, h, contentH, &state.off) ... EndScroll()
bracketing child widgets (parent-linked). Fixed a compounding-offset
bug where draw_tree's origin was mutated across children.
- k2b bakes a per-cartridge atlas (stb_truetype over the vendored
NotoSans) covering the cartridge's charset at its used pixel sizes,
embeds it as the kind 1 asset '@atlas'. K2B_FONT overrides the face.
- kry_sw renders atlas text: UTF-8 decoding, per-glyph advances,
source-over coverage blending, nearest-size scaling; measure uses
real advance widths. KrySwSetAtlas installs it; krb-run, krb-sdl,
and krb-web all load '@atlas' after KrbLoad.
- Cartridge cap raised 64 KiB -> 16 MiB (output buffer static) to fit
atlases/images; krb_cartridge_test budget adjusted. Engine goldens
regenerated (atlas advances change text layout).
- Fixed on the way: atlas record stride (18 bytes), pack buffer
ownership, and a realloc'd-header write in the baker.
Verified: 'Ag' at 24px renders as antialiased glyphs from embedded
bytes; full krb suite green.
'if (a > b) { ... } else { ... }' now compiles to compare + JZ/JMP
with true and false node ranges; the right side of a comparison can
be another mounted state path (PUSH_PATH) or an integer literal
(PUSH_CONST). Verified both branches with mounted and unmounted
state.
stb_image (vendored with raylib) decodes referenced Picture() files at
compile time; decoded RGBA8 goes in as kind 0 and renders through
texture_rgba in every engine. KRAW stays for hand-made raw pixels;
undecodable files (wav/ogg/fonts) remain opaque kind 2 blobs for
host-side unpacking. Verified: png cartridge renders after the source
file is deleted.
- krb-web is now a player: drop or pick a .krb, it writes to MEMFS
and boots the cartridge (krb_web_start export); no preload, the
bundle is a generic renderer. Drag-drop + file picker + canvas
mouse with correct scaling. Serving it anywhere gives the web a
KRB renderer.
- .github/workflows/renderers.yml: matrix builds krb-run binaries
(linux, windows mingw cross, macos) and the web player; artifacts
on every push, attached to releases on tags.
k2b now packs what a cartridge references, making it self-contained:
- Every Picture() path resolvable under --root is embedded at emit
time. .kraw files (KRAW magic + u16 w,h + RGBA8 pixels) go in as
kind 0 and render through texture_rgba in every engine; any other
file (png, wav, ogg, fonts) is embedded verbatim as a kind 2 opaque
blob for host-side decoding via KrbAssetFind — sounds and arbitrary
assets ride in the same section, unpackable by the application.
- The recorder backend forwards+logs texture_rgba (a NULL entry on
the wrapper silently forced the host-path fallback).
Verified end-to-end: a cartridge whose tile.kraw is deleted after
build still renders the picture, scaled and tinted, purely from
embedded bytes (texture_rgba 2x2 -> 8x8 in the recorded stream).
Cartridges stop needing host C for simple per-frame logic:
- k2b collects '<path> =/+=/-= N', '++', '--' statements from frame
bodies and simple 'if (<path> <cmp> <int>)' guards over widget
ranges, and emits them as VM opcodes: state updates run first, then
one OP_DRAW_NODE per drawable node with guarded ranges wrapped in
compare + JZ. Render-only cartridges still emit a single
OP_DRAW_TREE (golden output unchanged).
- parse_color now understands (Color){r,g,b,a} literals everywhere
(Rect etc.), not just in the circle parser.
- KrbExec JZ bug fixes: the jump-if-zero polarity was inverted, and a
taken jump was clobbered by the executor epilogue. Both were masked
by the hand-written test compiling its guard in positive form; a
k2b-compiled cartridge exposed them.
- krb-run --frames N runs the cartridge N frames (advancing time and
press edges) for observing state-dependent behavior headlessly.
Verified end-to-end: a .kry with counter += 1 and an if (counter < 4)
guard compiles to a 35-byte program; the guarded rect renders on
frames where the condition holds and disappears after, with the
counter mount showing 1+N.
The plan-07 core: cartridges stop being static pictures.
- New v2 opcodes: a 16-deep int stack machine (PUSH_CONST/PUSH_PATH/
POP_STORE, ADD..GE, JMP/JZ, TIME) plus OP_DRAW_NODE so UI can be
conditional on mounted state. Loader accepts v1 and v2; k2b now
writes version 2.
- New node types CIRCLE (center+radius) and RING (annulus), the shapes
the inbe breath visualizer needs; k2b parses DrawCircleV/DrawRing
(with (Color){r,g,b,a} literals). KryBackend gains optional circle/
ring entries — implemented in kry_sw, the raylib surface backend,
the null backend, and forwarded+logged by the recorder.
- tests/krb_logic_test.c: hand-assembled v2 cartridge proving counter
increments per frame, conditional node visibility across frames,
circle/ring rasterization bounds, and TIME. Engine golden test passes
unchanged on v2 output (render back-compat).
- KRB_FORMAT.md documents v2 and the R>=0x80 theme-slot color caveat.
Plan 11 phase 7 (pulled forward as the Android-template host):
kry_sw renders, SDL2 owns window/input/presentation via a streaming
RGBA texture. --png renders one frame through the renderer and reads
it back, for headless conformance under SDL_VIDEODRIVER=dummy.
Verified: SDL software-renderer readback of examples/02_buttons.kry at
400x300 is byte-identical (sha256) to the native golden frame — native,
wasm web, and SDL now render the same image.
make krb-sdl (pkg-config sdl2; on omega PKG_CONFIG_PATH points at
~/.local/sdl2 automatically in the rule).
Three parser defects that made k2c exit 0 while emitting broken C:
1. One-line control blocks ('if cond { body }', also while/for/switch/
case/else/guard) glued the braces into the condition. The finalized
logical line is now split into header/body/'}' and the parts re-enter
the main loop through a FIFO that outranks the stashed lookahead
(whose single slot the read-ahead would otherwise overwrite, losing
source lines). The read-ahead is also skipped for queued parts and
while a stash is pending.
2. Char literals containing structural characters ('"', '[', ']', '{',
'}') toggled the string/bracket scanners and swallowed following
lines; both brace scanners now skip char literals.
3. An assignment to a local named c was classified as a raw 'c <line>'
escape and emitted without its trailing semicolon; assignment
operators after the c token now fall through to the normal
statement path.
Plan 11 phase 3, wasm-first variant (pixel-identical to native):
- cmd/krb-web/main.c: emscripten host running the KRB runtime + kry_sw
rasterizer; each frame blits the RGBA buffer into an ImageData via
EM_ASM. Cartridge preloaded at /app.krb, canvas mouse events fed back
through exported krb_web_mouse/krb_web_button.
- cmd/krb-web/shell.html: minimal shell wiring Module.canvas and input.
- cmd/krb-web/node-capture.js: pre-js for the KRB_WEB_ONESHOT node
build; stubs a canvas 2D context and dumps the blitted frame to stdout
so the wasm blit path is testable without a browser.
- make krb-web KRB=examples/xx.kry builds the cartridge + bundle
(needs emcc on PATH, e.g. source ~/emsdk/emsdk_env.sh).
Verified: node oneshot capture of examples/02_buttons.kry at 800x600 is
byte-identical (sha256) to the native krb-run render; page loads and
runs in a browser.
Plan 11 phases 1-2 core:
- src/backend/kry_sw.c: portable software rasterizer behind the
KryBackend vtable. RGBA8 target with RGB565 conversion, clip stack,
input injection, theme slots, public-domain font8x8 text (glyph-atlas
pipeline replaces it later without interface changes).
- src/backend/kry_backend_rec.c: recording backend that logs the
cartridge draw-call stream while delegating to an inner engine.
- cmd/krb-run: headless cartridge runner; renders one frame to PNG
(dependency-free writer, stored deflate) and/or dumps the call stream.
- tests: kry_sw unit test plus tests/krb_engine_test.sh golden
conformance over examples/02_buttons.kry (sha256 goldens, refresh
with KRB_ENGINE_REGOLDEN=1), wired into make test / make tools.