build: Nix flake + Meson/Ninja build system; expand ROADMAP; CI for both - #14
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.build, default Ninja backend): standalone build of the core libdb C library on POSIX. Native platform detection ->db_config.h; assemblesdb.h(db.in+api_flags.in+ext_def.in+ext_prot.in),db_int.h,db_int_def.h,clib_port.hviameson/gen_header.py+meson/db_subs.json(mirrorsdist/configuresubstitution); pthread mutexes, crypto, replication;clib/fallbacks gated onhas_function. Verified locally: buildslibdb.dylib;db_version()links and runs.flake.nix):packages.libdb-meson(default, via nix meson hooks),packages.libdb-autoconf(build_unix), a dev shell, andchecks.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-linkdb_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 (pergburd/noxu), JE-style index-in-WAL + cleaner option for btree/hash (LSM-HASH ~ Bitcask), and finishing the docs tree.