master repository for XO: cooperating set of C++ libraries for deterministic simulation
  • C++ 84.6%
  • C 5%
  • CMake 3.8%
  • JavaScript 2.1%
  • Python 1.5%
  • Other 2.8%
Find a file
Roland Conybeare 339edf668c
Some checks failed
cmake-docker / cmake-build (clang, clang++) (push) Failing after 42m42s
cmake-docker / cmake-build (gcc, g++) (push) Has been cancelled
CI / smoke-test (push) Failing after 39m28s
xo-reflect xo-printjson: reflect supports map types [FEATURE]
2026-10-11 01:26:34 -04:00
.forgejo/workflows github forjejo: ci facepalm [BUGFIX] 2026-10-03 13:46:23 -04:00
.github/workflows github forjejo: ci facepalm [BUGFIX] 2026-10-03 13:46:23 -04:00
_static/img xo-umbrella: + docs support files 2025-06-22 16:19:21 -05:00
cmake xo-cmake: generate .build/reconfigure.sh script to rerun cmake 2026-01-11 14:05:05 -05:00
docs sdlc: genai prompt 2026-08-08 20:50:43 -04:00
etc build: generate etc/{hostegl,hostubunut} symlinks [BUILD] [TIDY] 2026-09-25 09:03:05 -04:00
patches refactor nix: consolidate xo deps 2026-05-25 12:11:36 -04:00
pkgs xo-websock: draw IntrospectReceiver [FEATURE] 2026-10-04 00:50:28 -04:00
xo-alloc refactoring _ostream.hpp _pp.hpp vs ODR [REFACTOR] 2026-08-17 00:38:44 -04:00
xo-alloc2 build: misc fixes to not-self-sufficient headers 2026-09-27 18:38:58 -04:00
xo-allocutil build: misc fixes to not-self-sufficient headers 2026-09-27 18:38:58 -04:00
xo-arena xo-arena etc. fixes for OSX utest suite [UTEST] [TIDY] 2026-09-26 00:28:49 -04:00
xo-callback xo-reflect: wrapper-reflection for Callbackid [REFACTOR] 2026-10-06 23:05:05 -04:00
xo-callback2 xo-flatstring: + sprintf + concat + use w/ arena [REFACTOR] [FEATURE] 2026-09-09 00:34:03 -04:00
xo-cmake xo-cmake: + missing subsystem edges 2026-10-04 12:22:33 -04:00
xo-distribution build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-equable2 regenerate facet inra [TIDY] 2026-09-12 17:02:25 -04:00
xo-expression xo-expression: delete o.g. copy of FunctionExprInterface [TIDY] 2026-09-27 18:14:10 -04:00
xo-expression2 regenerate facet inra [TIDY] 2026-09-12 17:02:25 -04:00
xo-facet xo-arena etc. fixes for OSX utest suite [UTEST] [TIDY] 2026-09-26 00:28:49 -04:00
xo-flatstring xo-arena + xo-flatstring work [REFACTOR] [FEATURE] 2026-09-09 09:38:10 -04:00
xo-gc xo-arena stack: make _lo private; add DArena::_mem_lo() 2026-09-19 15:39:36 -04:00
xo-hashable2 regenerate facet inra [TIDY] 2026-09-12 17:02:25 -04:00
xo-imgui refactoring _ostream.hpp _pp.hpp vs ODR [REFACTOR] 2026-08-17 00:38:44 -04:00
xo-indentlog git subrepo push xo-indentlog 2026-08-13 20:51:13 -04:00
xo-indentlog2 xo-printjson: depth limit for json printing [FEATURE] 2026-10-04 23:12:34 -04:00
xo-interpreter xo-expression: retire operator<< for exprtype [REFACTOR] 2026-08-22 23:21:13 -04:00
xo-interpreter2 build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-jit xo-jit: delete stale activation_record ghosts [TIDY] 2026-09-27 18:13:04 -04:00
xo-kalmanfilter xo-reflect: remember derived-from rel between types [FEATURE] 2026-10-09 09:01:11 -04:00
xo-numeric regenerate facet inra [TIDY] 2026-09-12 17:02:25 -04:00
xo-object build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-object2 xo-printjson: generic json printer uses reflect [REFACTOR] 2026-10-05 10:25:11 -04:00
xo-ordinaltree xo-randomgen: use PpSink to retire ostream use [REFACTOR] 2026-08-22 10:08:35 -04:00
xo-ppsink xo-ppsink: need #include for clang [BUGFIX] 2026-09-12 23:49:55 -04:00
xo-printable2 build: misc fixes to not-self-sufficient headers 2026-09-27 18:38:58 -04:00
xo-printjson xo-reflect xo-printjson: reflect supports map types [FEATURE] 2026-10-11 01:26:34 -04:00
xo-procedure2 xo-procedure2: drop dead file [TIDY] 2026-09-27 18:24:03 -04:00
xo-process xo-reactor2: + ObjectEvent + utest [FEATURE] 2026-08-29 14:27:57 -04:00
xo-pyarena xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pydistribution xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pyexpression xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pyfacet xo-facet: AllocFlywheel -> namespace xo::facet [TIDY] 2026-09-20 11:47:09 -04:00
xo-pyindentlog2 xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pyjit xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pykalmanfilter xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pyobject2 xo-facet: common base align recovers alloc size from ptr [REFACTOR] 2026-09-25 08:20:21 -04:00
xo-pyprintjson xo-pyprintjson: appcx + utest [PYBIND] [UTEST] 2026-09-13 14:40:54 -04:00
xo-pyprocess xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pyreactor xo-pyreactor: drop stream_endpoint_descr, http_endpoint_descr [WIP] 2026-09-26 13:35:50 -04:00
xo-pyreactor2 xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pyreactor2websock xo-pyreactor2websock: new subsystem [REFACTOR] 2026-09-26 13:49:02 -04:00
xo-pyreflect xo-reflect xo-printjson: reflect supports map types [FEATURE] 2026-10-11 01:26:34 -04:00
xo-pysimulator xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pystringtable2 xo-facet: AllocFlywheel -> namespace xo::facet [TIDY] 2026-09-20 11:47:09 -04:00
xo-pyunit xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pyutil xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-pywebsock xo-websock: reflect types used in introspect ex [FEATURE] 2026-10-02 00:14:27 -04:00
xo-pywebutil xo-cmake: generate python module #includes [HYGIENE] 2026-09-13 12:00:21 -04:00
xo-randomgen build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-ratio xo-reflectutil: globally unique typeseq::id() [BUGFIX] 2026-09-21 21:17:27 -04:00
xo-reactor build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-reactor2 build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-reactor2websock xo-websock: reflect+printjson for WebserverConfig [FEATURE] 2026-10-04 10:58:51 -04:00
xo-reader nix build: restore xo-reader utest [UTEST] [NIX] 2026-09-13 13:07:40 -04:00
xo-reader2 build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-refcnt build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-reflect xo-reflect xo-printjson: reflect supports map types [FEATURE] 2026-10-11 01:26:34 -04:00
xo-reflectable2 xo-reflect + xo-printjson + xo-websock [FEATURE] 2026-10-10 10:39:59 -04:00
xo-reflectutil xo-reflectutil: minor refactor [TIDY] 2026-09-22 08:59:49 -04:00
xo-simulator xo-reactor: drop ostream from AbstractEventProcessor api [REFACTOR] 2026-08-23 18:14:36 -04:00
xo-statistics build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-stringtable2 xo-printjson stack: handle cycle graphs [FEATURE] 2026-10-05 00:05:05 -04:00
xo-subsys xo-facet: evidence for appx + json printers [FEATURE] 2026-09-17 08:43:26 -04:00
xo-symboltable xo-symboltable: clang-format include order [TIDY] 2026-08-02 13:41:24 -04:00
xo-testutil build: fix non-self-sufficient header [BUGFIX] 2026-09-27 18:39:21 -04:00
xo-timeutil tidy cmake export ordering 2026-08-16 00:30:49 -04:00
xo-tokenizer xo-tokenizer: upgrade xo-indentlog2 tostr [WIP] [REFACTOR] 2026-08-16 00:34:03 -04:00
xo-tokenizer2 build: delete unused sources [TIDY] 2026-09-27 18:36:11 -04:00
xo-type regenerate facet inra [TIDY] 2026-09-12 17:02:25 -04:00
xo-unit xo-flatstring: + sprintf + concat + use w/ arena [REFACTOR] [FEATURE] 2026-09-09 00:34:03 -04:00
xo-websock xo-reflect xo-printjson: reflect supports map types [FEATURE] 2026-10-11 01:26:34 -04:00
xo-webutil xo-reflect: wrapper-reflection for Callbackid [REFACTOR] 2026-10-06 23:05:05 -04:00
.clangd cosmetic: + BACKLOG.md + .clangd change 2026-03-24 22:22:20 -04:00
.gitignore build: generate etc/{hostegl,hostubunut} symlinks [BUILD] [TIDY] 2026-09-25 09:03:05 -04:00
BACKLOG.md xo-interpreter2: virtual root for VSM itself 2026-03-25 20:06:40 -04:00
ci-nxfs.nix nix build: + ci-nxfs.nix + overlay.nix [NIX] 2026-06-06 17:45:56 -04:00
ci.nix xo-pyreactor2websock: new subsystem [REFACTOR] 2026-09-26 13:49:02 -04:00
CLAUDE.md sdlc: genai prompt 2026-08-08 20:50:43 -04:00
CMakeLists.txt xo-pyreactor2websock: new subsystem [REFACTOR] 2026-09-26 13:49:02 -04:00
conf.py xo-alloc2: ++ documentation + threshold size for THP feature 2025-12-23 21:06:38 -05:00
default.nix nix build: + ci-nxfs.nix + overlay.nix [NIX] 2026-06-06 17:45:56 -04:00
Doxyfile.in xo-umbrella: + docs support files 2025-06-22 16:19:21 -05:00
FAQ-DEV.md xo-objectd2 xo-printable xo-facet: pp working for List(Integer) 2026-01-09 17:48:54 -05:00
imgui.ini gitignore: + compile_commands.json (symlink) 2026-05-19 08:28:25 -04:00
index.rst xo-gc: docs build [WIP] + misc fixes + works w/ nix 2026-02-26 14:27:02 +11:00
LICENSE + docs in xo-alloc2/ + misc improvements 2025-12-11 22:18:09 -05:00
overlays.nix nix env: drop unused fish-overlay 2026-07-08 08:47:46 -04:00
README.md Initial commit 2026-09-26 13:39:03 -04:00
shells.nix nix build: + pkgs/xo-interpreter.nix + xo.interpreter [NIX] 2026-08-08 17:45:57 -04:00
xo.nix nix build: xo-websock buildExamples flag [NIX] 2026-09-27 13:10:47 -04:00

Introduction

Local nix build for xo libraries. Intended for local development work, with source in immediate subdirectories.

Features

  • native c++
  • deterministic simulation
  • reflection
  • python bindings

Getting Started

(Alternatively, see xo-umbrella2/docs/install.rst for similar content)

Nix shell (reproducible development environment)

If nix is available, can get several reproducible build environments.

Pick one for a session:

$ cd xo-umbrella2
$ nix-shell -A shell0  # just nix stdenv: make,gcc,bash etc.
$ nix-shell -A shell1  # stable environment
$ nix-shell -A shell2  # stable environment + emacs + lsp
$ nix-shell -A shell3  # stable environment + emacs + lsp + xorg/opengl/vulkan/imgui stack (wsl2-only)
$ nix-shell -A shell4-osx  # stable environment + emacs + lsp + imgui stack (osx-only)
$ nix-shell -A shell4  # wsl2-specific. like shell3, vkcube works (at least on WSL)
$ nix-shell -A shell5  # wsl2-specific. uses dxg driver for "hardware acceleration"
$ nix-shell -A shell   # (deprecated) bleeding edge environment

Run emacs (for example) from within chosen seesion. We need this ordering because nix-shell determines vital details like location of shared libraries, including libraries used by running IDE.

$ emacs

Can use nix-shell to get reproducible environment for cmake build, see Cmake Build. Alternatively can use full nix build, see Nix Build

Cmake build

If nix is available, you probably prefer the nix build, unless working on XO itself. Otherwise continue reading..

$ PREFIX=/path/to/say/home/local
$ cd xo-umbrella2
$ (cd xo-cmake && cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -B .build -S . && cmake --install .build)
$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DXO_ENABLE_EXAMPLES=1 -DXO_ENABLE_DOCS=1 -DCMAKE_BUILD_TYPE=debug
$ cmake --build .build --verbose
$ cmake --install .build

or with Vulkan examples

$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DXO_ENABLE_EXAMPLES=1 -DXO_ENABLE_VULKAN=1

Re-run cmake

$ cd xo
$ .build/reconfigure -n
cmake -B /home/roland/proj/xo-umbrella2-claude1/.build -S /home/roland/proj/xo-umbrella2-claude1 \
    -DCMAKE_BUILD_TYPE=debug \
    -DCMAKE_INSTALL_PREFIX=/home/roland/local \
    -DCMAKE_INSTALL_DOCDIR=share/doc/xo-umbrella \
    -DCMAKE_MODULE_PATH=/home/roland/proj/xo-umbrella2/xo-cmake/cmake \
    -DCMAKE_PREFIX_PATH= \
    -DCMAKE_CXX_STANDARD=20 \
    -DXO_CMAKE_CONFIG_EXECUTABLE=/home/roland/local/bin/xo-cmake-config \
    -DENABLE_TESTING=1 \
    -DXO_ENABLE_DOCS=1 \
    -DXO_ENABLE_ASM=1 \
    -DXO_ENABLE_EXAMPLES=1 \
    -DXO_ENABLE_VULKAN=1 \
    -DXO_ENABLE_OPENGL=ON
$ .build/reconfigure  # to rerun cmake

Cmake build documentation

Documentation relies on doxygen, sphinx and breathe.

# phase 2
$ cd xo-umbrella2
$ cmake -B .build -S . -DXO_ENABLE_DOCS=1
$ cmake --build .build -- docs

Create Html docs in .build/sphinx/html/index.html

Cmake build with coverage

Prepare build

# phase 2
$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_BUILD_TYPE=coverage -DENABLE_TESTING=1
$ cmake --build .build --

Run coverage-enabled unit tests

$ (cd .build && ctest)

Generate coverage report

$ .build/gen-ccov
# or:
$ cmake --build .build --target ccov

Html report left in .build/ccov/html/index.html

Nix Build

Nix build uses toplevel default.nix, along with top-level pkgs/xo-foo.nix for each subproject foo. It doesn't interact with toplevel CMakeLists.txt.

$ nix-build -A xo-userenv

This builds all xo subprojects, assembles sandbox under ./result.

$ tree -L 1 ./result
./result
├── bin
│   ├── xo-build
│   ├── xo-cmake-config
│   └── xo-cmake-lcov-harness
└── share
    ├── cmake
    │   └── xo_macros
    │       ├── code-coverage.cmake
    │       ├── xo-project-macros.cmake
    │       └── xo_cxx.cmake
    ├── etc
    │   └── xo
    │       └── subsystem-list
    └── xo-macros
        ├── Doxyfile.in
        ├── gen-ccov.in
        └── xo-bootstrap-macros.cmake

For completeness' sake: can also use

$ nix-build -A xo-userenv-slow

Same result as $nix-build -A xo-userenv, but builds each package serially using xo-build.

Finally, can also individual XO packages:

$ nix-build -A xo.cmake
$ nix-build -A xo.indentlog
...

Nix + SDL2 + Vulkan + ImGui

Currently (Nov 2025) only affects xo-umbrella2/xo-imgui.

For OSX, imgui works with assistance from motlenvk. Build xo-imgui with

$ cd xo-umbrella2
$ nix-shell -A shell4-osx   # see xo-umrbella2/default.nix for impl

For linux and/or wsl build need extra care:

  1. must use host OS for gpu drivers. nixpkgs has drivers, but they're setup to work from nixos.
  2. want to use nixpkgs for the GPU-independent portion of graphics stack.

Complication because host gpu drivers in a "big swimming pool" such as /usr/lib/x86_64-linux-gnu/ that contains both libraries that must come from host OS (e.g. libGLX_nvidia) and libraries that must come from nixpkgs (e.g. libc)

Finesse by introducing a directory-of-symlinks, see xo-umbrella2/etc/{hostegl, hostubuntu}.

The symlinks are generated. Build them with:

$ ./etc/gen-hostegl                  # profile autodetected; --profile=egl|ubuntu to force
$ ./etc/gen-hostegl -n               # dry run

The list of libraries to look for is committed, see etc/host{egl,ubuntu}.known.

--mode=derived instead seeds from the host's glvnd and Vulkan ICD manifests and walks ldd to a fixpoint. Self-adapting. --compare to see what it would add and drop against the known list before relying on it.

An ordinary cmake build may cheerfully use the host-provided graphics stack, in return for higher risk of DLL hell.

To build for ubuntu with nvidia gpu:

$ cd xo-umbrella2
$ nix-shell -A shell4-nvidia
# then regular cmake:
$ cmake -B .build -S . -DXO_ENABLE_VULKAN=1 -DXO_ENABLE_EXAMPLES=1 -DCMAKE_INSTALL_PREFIX=$PREFIX

To build for wsl:

$ cd xo-umbrella2
$ nix-shell -A shell4-wsl
# then regular cmake:
$ cmake -B .build -S . -DXO_ENABLE_VULKAN=1 -DXO_ENABLE_EXAMPLES=1 -DCMAKE_INSTALL_PREFIX=$PREFIX

Currently not supporting a nix sandbox build for xo-imgui

Directory Layout

(not in alphabetical order)

xo-umbrella2/
|
+- CMakeLists.txt                 top-level cmake config
+- cmake
|  \- xo-bootstrap-macros.cmake   configure xo cmake support for build
+- compile_commands.json          symlink to path/to/build/compile_commands.json for LSP
|
+- conf.py                        sphinx config for project documentation
+- index.rst                      root of xo-umbrella2 doc tree
+- Doxyfile.in                    doxygen config template; cmake will prepare Doxyfile in build dir
+- _static/                       static inputs to sphinx
|
+- doc
|  +- glossary.rst                glossary for umbrella documentation
|  \- install.rst                 umbrella install instructions
|
+- etc
|  +- gen-hostegl                 generates the two directories below
|  +- hostegl.known               basenames needed for WSL2 (committed)
|  +- hostubuntu.known            basenames needed for ubuntu+nvidia (committed)
|  +- hostegl/                    video driver symlinks for WSL2 (generated)
|  \- hostubuntu/                 video driver symlinks for ubuntu (generated)
|
+- default.nix                    top-level nix build (works w/ stock nixpkgs 25.05)
+- pkgs/                          per-satellite nix builds. see xo-umbrella2/default.nix
|  +- xo-callback.nix             nix build for xo-umbrella2/xo-callback
|  ..etc..
|  \- xo-webutil.nix
|
+- xo-alloc/                      xo-alloc subproject. independent git repo, using git subtree
+- xo-alloc2/                     xo-alloc2 subproject.
..etc..
\- xo-webutil/

Build/Install

See also docs/install.rst

cmake build

$ git clone https://github.com/rconybea/xo-umbrella2
$ cd xo-umbrella2
$ PREFIX=${HOME}/local  # or /usr/local or ...

# phase1 install helper scripts
$ cmake -B xo-cmake/.build -S xo-cmake -DCMAKE_INSTALL_PREFIX=$PREFIX
$ cmake --install xo-cmake/.build

# phase 2 -- configure & build XO, using helpers installed in phase 1.
# -DENABLE_TESTING=1 : builds unit tests
# -DXO_ENABLE_DOCS=1 : builds documentation; or 0 to skip
# -DXO_ENABLE_EXAMPLES=1 : builds examples; or 0 to skip
# -DXO_ENABLE_OPENGL=1 : builds opengl examples; or 0 to skip
# -DXO_ENABLE_VULKAN=1 : builds vulkan-dependent graphics pipeline for imgui; or 0 to skip
$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=$PREFIX -DXO_ENABLE_DOCS=1 -DXO_ENABLE_EXAMPLES=1 -DXO_ENABLE_VULKAN=1
$ cmake --build .build -j

# optionally build docs
$ cmake --build .build -- docs

# install
$ cmake --install .build

nix build

$ nix-build -A xo-userenv

output now in ./result

To view published docs

Documentation for each subsystem that builds it is published at conybeare.us/xo-docs/, refreshed by CI on every push to main. A subsystem appears there once its package in xo.nix sets buildDocs = true; see pkgs/xo-docs-site.nix.

To view docs locally

find local IP address

wsl:

$ hostname -I

linux

$ /usr/sbin/ifconfig -a

run nix build

$ nix-build -A xo-userenv

serve docs from some available port

$ (cd result && python3 -m http.server 3000)

browse to ":3000/share/doc/xo_flatstring/html"

To add a new satellite repo / missing satellite remote

  1. check clone in clean state (all local changes committed or unwound)

  2. add satellite as remote

$ xo-build -n --add-umbrella-remote xo-foo
git remote add xo-cmake git@github.com:Rconybea/xo-cmake.git
$ xo-build --add-umbrella-remote xo-foo
  1. fetch (for hygiene)
$ git fetch xo-foo main
  1. add subtree to local sandbox
$ git subtree add --prefix=xo-foo xo-foo main

To push changes to satellite repos

We use an explicit branch for each satellite

$ git branch --show-current
main

$ xo-build -n --push-umbrella-remote xo-foo
git subtree split --rejoin --prefix=xo-foo -b _demux/xo-foo
git push xo-foo _demux/xo-foo:main

$ xo-build --push-umbrella-remote xo-foo

To pull changes from satellite repos

$ xo-build -n --pull-umbrella-remote xo-foo
git subtree pull xo-foo main --rejoin
$ xo-build --pull-umbrella-remote xo-foo