From 714ec79f9b5cc44da9e9d517ed2e5eed01517f4e Mon Sep 17 00:00:00 2001 From: Aditya Mukhopadhyay Date: Wed, 26 Aug 2026 00:54:11 +0530 Subject: [PATCH] chore: raise binary-size CI budget from 1MB to ~1.2MB for #277 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The core binary was already at the 1MB wire before #277's structured error codes started landing; WAL (#360, 6 codes) + QRY (#361, 9 codes) combined added only ~9 KiB, and that alone tipped CI over. All existing size levers (opt-level=z, LTO, codegen-units=1, strip=symbols, and the already-non-generic error-coding macros) are maxed, so there is no single hotspot left to cut. Extrapolating the full 130-code rollout (PRS/STG/WAL/QRY/API+INT) projects ~60-70 KiB more growth, which the 1MB budget cannot absorb. Raises SIZE_LIMIT_BYTES and updates PHILOSOPHY.md/CLAUDE.md's stated target to match. User-approved philosophy deviation — see PHILOSOPHY.md §4. Part of #277 --- .github/workflows/binary-size.yml | 2 +- CHANGELOG.md | 16 ++++++++++++++++ CLAUDE.md | 2 +- PHILOSOPHY.md | 8 ++++++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/binary-size.yml b/.github/workflows/binary-size.yml index b36162efb6..88f0369154 100644 --- a/.github/workflows/binary-size.yml +++ b/.github/workflows/binary-size.yml @@ -14,7 +14,7 @@ jobs: name: Check release binary size runs-on: ubuntu-latest env: - SIZE_LIMIT_BYTES: 1048576 # 1 MiB — project goal is <1MB + SIZE_LIMIT_BYTES: 1228800 # 1200 KiB — raised from 1 MiB for #277's structured error codes; see PHILOSOPHY.md §4 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index d9cb6f8d5c..d05cdaee51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 canonical `{}`-placeholder template form so the registry↔doc sync test can compare them byte-for-byte; the concrete example now lives in each entry's prose instead. +- **The core binary size budget is raised from 1MB to ~1.2MB** (`binary-size.yml`'s + `SIZE_LIMIT_BYTES`, and PHILOSOPHY.md §4's stated target), toward #277. + The project was already at the 1MB wire before #277 started (measured + ~1034 KiB pre-rollout on a controlled local build); #360 (WAL, 6 codes) and + #361 (QRY, 9 codes) together added only ~9 KiB, and even that was enough to + fail CI. All existing size levers — `opt-level = "z"`, `lto = true`, + `codegen-units = 1`, `strip = "symbols"`, and the non-generic + `bail_coded!`/`err_coded!`/`format_template` design (no per-call-site + monomorphization, unlike the generic `build_btree` fixed for the same + reason in v0.x) — were already in place; `cargo bloat` shows no single + dominant symbol to cut, just diffuse growth across ~2000 small functions. + Extrapolating to the full 130-code rollout (PRS: 79, STG: 27, WAL: 6, + QRY: 9, API+INT: 9) puts the total growth at roughly 60-70 KiB over the + pre-#277 baseline, which no further micro-optimization of already-maxed + settings can absorb. ~1.2MB keeps meaningful headroom above that projection + without abandoning the philosophy's small-binary principle. ### Bug fixes diff --git a/CLAUDE.md b/CLAUDE.md index 72d356769b..ea88cb99e1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -16,7 +16,7 @@ Minigraf follows the "SQLite for bi-temporal graph databases" philosophy: - **Zero-configuration** - No setup, no config files, just works - **Embedded-first** - Library not server, in-process execution - **Single-file database** - One portable `.graph` file -- **Self-contained** - Minimal dependencies, small binary (<1MB goal) +- **Self-contained** - Minimal dependencies, small binary (~1.2MB budget as of #277; see PHILOSOPHY.md §4) - **Cross-platform** - Native, WASM, mobile, embedded - **Reliability over features** - Do less, do it perfectly - **Bi-temporal first-class** - Time travel is a core feature, not addon diff --git a/PHILOSOPHY.md b/PHILOSOPHY.md index 2b58a62515..8dc112e86e 100644 --- a/PHILOSOPHY.md +++ b/PHILOSOPHY.md @@ -109,7 +109,11 @@ SQLite's success comes from a clear philosophy: be a library, not a server. Be s - Pure Rust implementation - Minimal dependency tree (currently: serde, uuid, anyhow) - No required system libraries (optional backends OK) -- Target: <1MB binary for core engine +- Target: ~1.2MB budget for core engine (raised from the original <1MB goal for + #277's structured error codes — 130 documented codes across 6 categories + cannot fit in 1MB even with opt-level="z", LTO, codegen-units=1, and + strip=symbols all already applied; see CI's `binary-size.yml` for the + enforced limit) - No runtime dependencies (no JVM, no Python, no Node.js) **Anti-pattern**: Requiring external services, libraries, or runtimes to function. @@ -360,7 +364,7 @@ You'll know Minigraf has succeeded when: 1. ✅ **Ubiquity**: Developers say "just use Minigraf" for embedded graph storage 2. ✅ **Trust**: Known for never losing data, crash-safe, reliable 3. ✅ **Simplicity**: New users are productive in under 5 minutes -4. ✅ **Size**: Core binary under 1MB, minimal dependencies +4. ✅ **Size**: Core binary within its ~1.2MB budget, minimal dependencies 5. ✅ **Portability**: Runs everywhere from Raspberry Pi to browsers 6. ✅ **Stability**: API hasn't broken in years 7. ✅ **Documentation**: Comprehensive docs with examples