Skip to content

build: Nix flake + Meson/Ninja build system; expand ROADMAP; CI for both - #14

Merged
gburd merged 6 commits into
masterfrom
feat/build-and-roadmap
Jun 16, 2026
Merged

build: Nix flake + Meson/Ninja build system; expand ROADMAP; CI for both#14
gburd merged 6 commits into
masterfrom
feat/build-and-roadmap

Conversation

@gburd

@gburd gburd commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Adds a Nix flake and a Meson/Ninja build system alongside Autoconf, wires CI to exercise both, and expands the ROADMAP per the requested feature set.

Build systems (Autoconf kept intact)

  • Meson/Ninja (meson.build, default Ninja backend): standalone build of the core libdb C library on POSIX. Native platform detection -> db_config.h; assembles db.h (db.in+api_flags.in+ext_def.in+ext_prot.in), db_int.h, db_int_def.h, clib_port.h via meson/gen_header.py+meson/db_subs.json (mirrors dist/configure substitution); pthread mutexes, crypto, replication; clib/ fallbacks gated on has_function. Verified locally: builds libdb.dylib; db_version() links and runs.
  • Nix flake (flake.nix): packages.libdb-meson (default, via nix meson hooks), packages.libdb-autoconf (build_unix), a dev shell, and checks.default. Verified locally: nix build .#libdb-meson -> result/lib/libdb.dylib.

CI

Two new jobs in ci.yml: meson/ninja (ubuntu+macos: meson setup + ninja + smoke-link db_version) and nix-flake (nix build .#libdb-meson).

ROADMAP (expanded to 17 items)

Adaptive LSM (HanoiDB/gburd/aether + Amethyst segment-level adaptive leveled/tiered compaction), LeanStore/exmap buffer pool, B+Tree skip scan (PostgreSQL nbtree-style), AIO (io_uring/kqueue/IOCP) + prefetch across all access methods incl. the write path, HASH algorithm review (Ctrie/HAMT/lock-free), quorum systems (rs-quoracle) + Fast Paxos HA (per gburd/noxu), JE-style index-in-WAL + cleaner option for btree/hash (LSM-HASH ~ Bitcask), and finishing the docs tree.

gburd added 6 commits June 16, 2026 09:04
A standalone Meson build (default Ninja backend) for the core libdb C library
on POSIX (Linux/macOS/*BSD). Autoconf/build_unix remains the reference and
covers language bindings and non-POSIX platforms.

- meson.build: native platform detection -> db_config.h; assembles db.h
  (db.in + api_flags.in + ext_def.in + ext_prot.in), db_int.h, db_int_def.h,
  clib_port.h via meson/gen_header.py + meson/db_subs.json (mirrors what
  dist/configure substitutes); compiles the configured core source set
  (pthread mutexes, crypto, replication); clib/ libc fallbacks are gated on
  has_function. Builds libdb.{so,dylib}.

Verified locally: 'meson setup build-meson && ninja -C build-meson' produces a
usable libdb (db_version() links and runs).
flake.nix exposes:
- packages.libdb-meson (default): the Meson/Ninja core build, driven by nix's
  meson hooks (python3 for header generation).
- packages.libdb-autoconf: the reference build_unix/configure build.
- devShells.default: meson, ninja, python3, gcc/clang, autoconf, tcl.
- checks.default: builds the default package.

Verified: 'nix build .#libdb-meson' produces result/lib/libdb.dylib.
ROADMAP: add adaptive LSM (HanoiDB/aether + Amethyst segment-level adaptive
compaction), LeanStore/exmap buffer pool, B+Tree skip scan (nbtree-style),
AIO (io_uring/kqueue) + prefetch for all access methods incl. the write path,
HASH algorithm review (Ctrie/HAMT), quoracle + Fast Paxos HA (per noxu/
rs-quoracle), JE-style index-in-WAL + cleaner option (LSM-HASH ~ Bitcask), and
finishing the docs tree.

CI: add a meson/ninja job (ubuntu+macos, builds the library and smoke-links
db_version) and a nix-flake job (nix build .#libdb-meson).
Add docs/design/lsm.md comparing three log-structured implementations against
the Amethyst adaptive-compaction paper, and refine ROADMAP #9.

Findings:
- aether (Rust): HanoiDB levels + SuRF/Bloom + STRUCTURE-level adaptation
  (SingleIndex/Hybrid/MultiLevel via rolling metrics + hysteresis) + work-budget
  merge strategies. No leveled/tiered choice.
- Amethyst (paper): SEGMENT-level adaptive compaction (per-segment leveled/tiered
  FSM + counters + cooldowns) -- orthogonal to aether, same mechanism.
- libxtc (C): Bitcask append-only log + in-memory hash index = the LSM-HASH config.
- noxu (Rust): JE-style B+tree-in-WAL + cleaner + VLSN/replication = the
  index-in-WAL config.

Synthesis: a two-axis adaptive LSM (aether structure axis + Amethyst segment
policy axis) over one shared rolling-counter+cooldown controller; HanoiDB layout
+ SuRF/Bloom; and #9 (LSM) / #13 (HASH) / #14 (index-in-WAL) share one
log-structured core (Bitcask for HASH, JE cleaner for B-tree).
/#14

lab/lsm: standalone prototype of the two-axis adaptive controller from
docs/design/lsm.md -- one rolling-window + cooldown core driving the structure
axis (SINGLE/HYBRID/MULTILEVEL) and the per-segment policy axis (LEVELED/
TIERED). Deterministic (virtual tick). test_adaptive.c runs an Amethyst-style
phase-shifting workload; all assertions pass (spawn/collapse, anti-flap, and
per-segment convergence with no churn). 'make check' to run.

ROADMAP: #13 now ties the HASH-algorithm review to the Bitcask/LSM-HASH
in-memory directory (Ctrie/HAMT); #14 ties the JE index-in-WAL + cleaner to the
shared log-structured core (cleaner == compactor) and the adaptive controller.
Both reference docs/design/lsm.md.
@gburd
gburd merged commit 9b4ae6b into master Jun 16, 2026
@gburd
gburd deleted the feat/build-and-roadmap branch June 16, 2026 15:01
gburd added a commit that referenced this pull request Jul 31, 2026
Add docs/design/lsm.md comparing three log-structured implementations against
the Amethyst adaptive-compaction paper, and refine ROADMAP #9.

Findings:
- aether (Rust): HanoiDB levels + SuRF/Bloom + STRUCTURE-level adaptation
  (SingleIndex/Hybrid/MultiLevel via rolling metrics + hysteresis) + work-budget
  merge strategies. No leveled/tiered choice.
- Amethyst (paper): SEGMENT-level adaptive compaction (per-segment leveled/tiered
  FSM + counters + cooldowns) -- orthogonal to aether, same mechanism.
- libxtc (C): Bitcask append-only log + in-memory hash index = the LSM-HASH config.
- noxu (Rust): JE-style B+tree-in-WAL + cleaner + VLSN/replication = the
  index-in-WAL config.

Synthesis: a two-axis adaptive LSM (aether structure axis + Amethyst segment
policy axis) over one shared rolling-counter+cooldown controller; HanoiDB layout
+ SuRF/Bloom; and #9 (LSM) / #13 (HASH) / #14 (index-in-WAL) share one
log-structured core (Bitcask for HASH, JE cleaner for B-tree).
gburd added a commit that referenced this pull request Jul 31, 2026
/#14

lab/lsm: standalone prototype of the two-axis adaptive controller from
docs/design/lsm.md -- one rolling-window + cooldown core driving the structure
axis (SINGLE/HYBRID/MULTILEVEL) and the per-segment policy axis (LEVELED/
TIERED). Deterministic (virtual tick). test_adaptive.c runs an Amethyst-style
phase-shifting workload; all assertions pass (spawn/collapse, anti-flap, and
per-segment convergence with no churn). 'make check' to run.

ROADMAP: #13 now ties the HASH-algorithm review to the Bitcask/LSM-HASH
in-memory directory (Ctrie/HAMT); #14 ties the JE index-in-WAL + cleaner to the
shared log-structured core (cleaner == compactor) and the adaptive controller.
Both reference docs/design/lsm.md.
gburd added a commit that referenced this pull request Jul 31, 2026
build: Nix flake + Meson/Ninja build system; expand ROADMAP; CI for both
gburd added a commit that referenced this pull request Jul 31, 2026
…ted bugs)

- Mark DESIGN.md v1.x catalog items done (stale-read #D, secondary #5,
  cursor #30, checkpoint-LSN #18, split-torn #21, recovery-robustness #14).
- Document the swarm methodology + measured fault-activation coverage
  (2000-seed soak: 0 violations; torn 74% corrupt 73% stale 50% enospc 50%
  latency 75% shorteio 47%) and the dst-swarm.sh aggregate driver.
- Update the planted-bug table to five bugs (add ABORTNOUNDO, CKPBADLSN),
  all caught at K=1; note the honest remaining gaps (v2 multi-process
  scheduler, determinism-guard planting, os_aio/__os_physwrite, WAL-record
  read hook).
- README: 24 scenarios + swarm, five planted bugs, dst-swarm.sh usage.
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