Skip to content

arigl: the GL Ariadne runtime, in a window or the terminal - #726

Merged
transfix merged 1 commit into
masterfrom
feat/arigl
Oct 20, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/arigl

Conversation

@transfix

@transfix transfix commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

arigl is the GL Ariadne runtime. It runs a .ari document over cvcGL either in a real window with a GL context (ImGui over the VTK scene) or, with --terminal, in the terminal, its scene rendered offscreen behind FTXUI or tvision widgets. It is the second of the runtimes Joe named: ari (core), arigl (GL) and arisrv (headless server, from the conference work).

It builds on #721 (merged), which gave documents their own command line and the shared runtime flags.

The runtime

arigl run      [--terminal] [flags] doc.ari [document args...]
arigl snapshot --png out.png [flags] doc.ari [document args...]     # an offscreen window frame
arigl snapshot --terminal [--ansi] [--png scene.png] doc.ari [...]  # a terminal frame as text
arigl check    [flags] doc.ari
  • Flags. The general flags every runtime shares (host_cli.h, from ariadne: a document owns its command line (argv + args:), shared runtime flags #721), plus --terminal. Everything after the document path belongs to the document (args: / argv).
  • Terminal graphics (from ariadne: persist table column widths (tree.<id>.columns); fix the row-split 16 px first-walk pin #727) work as they do in ari: --graphics auto|kitty|sixel|color|mono and --cell-size in terminal mode, and --image NAME=FILE in both modes.
  • Signals. OS signals go to on_signal: in both modes. In window mode no GL host did this before. A signal the document doesn't handle exits 128 + N.
  • Snapshots run on a fixed clock, so frames are reproducible.
  • Defaults. The document root is ui.docs.ari in both modes, the same as ari, so a document's state paths don't change between runtimes.
  • Existing examples. ariadne_hello, ariadne_stream, ariadne_conference and ariadne_terminal are untouched. Joe's rule is that demos are added and never replaced, and arigl is meant to replace them only once it does everything they do.

Library pieces

  • inc/cvc/gl/ariadne/bundles.h names the registration sets the example hosts each copied:
  • AriRuntime gains:
    • post_signal and post_input;
    • an input pump that runs before the drain, so touch, SDL and trapped signals arrive the same frame;
    • a fixed scene clock;
    • the accessors app_runtime(), backend() and realized();
    • ariadne_hello parity: the scene-node customs check before realizing, and the scene's background.
  • SceneAdapter::verify: an optional customs check that AppRuntime::load runs before realize. It does nothing by default.

Docs

  • docs/ARIADNE.md §9: the three runtimes and the arigl CLI.
  • Roadmap §16.6: the "pixel mirror" product mode is dropped as superseded by arigl --terminal, which draws the scene behind real terminal widgets.
  • A known gap found while testing, which also predates this PR: an auto-sized ImGui window (pos: but no size:) draws as a collapsed stub in ariadne_hello and arigl alike (hello.ari's Controls, terminal_tour.ari's Status and Layout). A sized window draws fine. It's a separate fix.

Verification

  • New ctests run the binary itself (in-tree, under the GL-context lock, skipped without FTXUI):
    • arigl_terminal_snapshot;
    • arigl_document_args (--agents 77 reaches the document);
    • arigl_rejects_bad_document_args (exits 2);
    • arigl_window_snapshot;
    • arigl_check.
  • All 392 core Ariadne tests and all 69 cvcgl_* tests pass locally.
  • arigl check loads every shipped .ari with exit 0.
  • arigl --terminal --png writes the same file byte for byte as ariadne_terminal --png.
  • The window snapshot's scene matches ariadne_hello --png on the same document (arigl also draws the ImGui overlay; ariadne_hello's capture hides it).
  • By hand:
    • window mode (DISPLAY on this box): terminal_tour.ari --agents 99 shows Agents 99; on_signal takes the first SIGUSR1 and quits on the second (exit 0); an unhandled SIGTERM exits 143.
    • in tmux: --terminal with FTXUI renders the scene behind the Scene window, orbits on a drag and exits 0 on Ctrl-C; --terminal --backend tvision shows the native desktop and exits 143 on SIGTERM.

Not in this PR

  • An arigl cvcpkg package. It comes after the platform-coverage work lands, because both edit publish-cvcpkg.yml.
  • stream_view in the terminal (planned next).
  • The conference fold-in (owned by the conference session).
  • Retiring the example hosts.

arigl runs a .ari document over cvcGL: in a real window with a GL context (ImGui over the VTK
scene), or with --terminal in the terminal, its scene rendered offscreen behind FTXUI or tvision
widgets. It is the GL sibling of `ari`. It takes the same general flags (host_cli.h) plus
--terminal; everything after the document path is the document's (doc_args.h).

- src/arigl: run | snapshot | check. A snapshot runs on a fixed clock: an offscreen window frame
  to --png, or a terminal frame as text. OS signals go to on_signal: in both modes, and one the
  document does not handle exits 128 + N. Dual-mode CMake like src/ari (CVC_BUILD_ARIGL, with
  CVC_BUILD_CVCGL), plus ctest coverage of the binary.
- cvcGL bundles.h: the registration sets the example hosts each copied: register_gl_basics,
  register_streaming, register_window_widgets, and register_conference for the conference fold-in.
- AriRuntime: post_signal, post_input, an input pump that runs before the drain, a fixed scene
  clock, and the app_runtime() / backend() / realized() accessors. Like ariadne_hello, it now checks
  the scene-node customs before realizing and applies the scene's background.
- SceneAdapter::verify: a scene-node customs check AppRuntime::load runs before realize (default:
  nothing to check).
- Docs: the three runtimes (ari, arigl, arisrv); §16.6's pixel-mirror mode is dropped as
  superseded; a known gap: auto-sized ImGui windows draw as a stub (pre-existing).
@transfix
transfix merged commit 8a39bed into master Oct 20, 2026
25 checks passed
transfix added a commit that referenced this pull request Oct 27, 2026
The SDK bundle builds only the cvc and cvcGL targets, then installs everything configured. Since
#726 the in-tree build also configures arigl (CVC_BUILD_ARIGL defaults ON with cvcGL), so
cmake --install failed on the missing bin/arigl.js: v3.7.1's tag run (40467963445) stopped there
and published nothing. Turn it off as CVC_BUILD_ARI already is; the browser arigl page ships with
the gh-pages gallery.
@transfix
transfix deleted the feat/arigl branch October 29, 2026 20:52
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.

1 participant