DST
  • C++ 91.6%
  • CMake 4%
  • Makefile 1.6%
  • Just 1.5%
  • Nix 1.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-02 14:25:13 +05:30
docs docs: align wrapper and fault-profile references with the registry and fault stream 2026-08-30 22:04:38 +05:30
examples examples(cmake): wrap calloc/realloc in sim example targets 2026-08-30 20:53:21 +05:30
include/cosmos sim: draw OOM decisions from a seeded Memory fault sub-stream 2026-08-30 22:04:14 +05:30
src/cosmos wrappers(wrap_memory.cpp): unregister orphaned block after release 2026-08-31 22:11:22 +05:30
tests test(wrappers): cover orphaned-block registry release 2026-08-31 22:11:26 +05:30
.clang-format style: configure left pointer alignment and single-line short ifs in .clang-format 2026-08-12 19:23:42 +05:30
.envrc
.gitignore feat(time): add saturating Time/Duration types and clean up clock wrappers 2026-08-30 18:09:07 +05:30
AGENTS.md repo(AGENTS.md): instruct agent to plant denial file for PR and one-shot requests 2026-09-02 14:25:13 +05:30
CMakeLists.txt build(cmake): configure build options and unit test subdirectory 2026-08-11 23:02:17 +05:30
flake.lock build(nix): add flake.lock for pinned dependencies 2026-08-11 23:01:33 +05:30
flake.nix fix(core): resolve Phase 0 review findings across time, sim, and memory 2026-08-30 19:34:59 +05:30
Justfile fix(core): resolve Phase 0 review findings across time, sim, and memory 2026-08-30 19:34:59 +05:30
Makefile fix(core): resolve Phase 0 review findings across time, sim, and memory 2026-08-30 19:34:59 +05:30
README.md build(sim): add sim recipe to Justfile, Makefile, and README 2026-08-11 23:00:05 +05:30

Cosmos

Cosmos is an embeddable C++ library for Deterministic Simulation Testing (DST) for C/C++ applications via standard POSIX library function interposition (-Wl,--wrap).

It provides zero-code-change simulation testing for standard POSIX functions (malloc, free, pthread_create, clock_gettime, socket, send, recv, open, write, fsync, getrandom).

Documentation

Full documentation is available in the docs/ directory:

Quick Start

Using just or make:

# Production build
just build       # or make build

# Simulation build (builds simulation binaries only)
just sim         # or make sim (or just s)

# Build and run tests
just test        # or make test (or just t)


# Build all targets (production binaries, simulation examples, and tests)
just all         # or make all

# Format codebase & check formatting
just format      # or make format
just format-check # or make format-check
just lint        # or make lint


# Clean build artifacts
just clean       # or make clean

Or using CMake directly:

# Configure and build libcosmos, tests, and simulation examples
cmake -B build -DCOSMOS_BUILD_TESTS=ON
cmake --build build

# Run unit tests
ctest --test-dir build --output-on-failure

# Run simulation examples directly
./build/examples/single_node/kv_store_sim
./build/examples/distributed/replicated_kv_sim

Examples