Repository navigation
chore: raise binary-size CI budget from 1MB to ~1.2MB for #277 - #367
Merged
Merged
Conversation
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
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
adityamukho
added a commit
that referenced
this pull request
Aug 25, 2026
adityamukho
added a commit
that referenced
this pull request
Aug 25, 2026
- Drop derive(Debug) on ErrorCode: with the registry growing to 130 variants across #277's six category PRs, the generated per-variant match arm is pure binary-size cost with no runtime use — nothing formats an ErrorCode with {:?}. - Hand-write CodedError's Debug impl instead of deriving it, reusing the already-formatted message and the stable code string rather than requiring ErrorCode: Debug. - Mark CodedError::new #[cold]/#[inline(never)]: error construction is the cold path at every bail_coded!/err_coded! call site (currently ~50, eventually ~250+), so keep the registry lookup + format_template call out of line instead of duplicating it inline per call site. Toward the binary-size pressure from #277 (see #367's raise of the CI budget from 1MB to ~1.2MB for the full context). Part of #277
adityamukho
added a commit
that referenced
this pull request
Aug 25, 2026
adityamukho
added a commit
that referenced
this pull request
Aug 25, 2026
…365) * feat: migrate storage call sites to STG-0xx error codes — #277 (3/6) Part of #359 (STG sub-issue of the #277 structured error codes rollout). Migrates bail!/anyhow! call sites in src/storage/{mod,persistent_facts, btree,btree_v6,packed_pages}.rs and src/storage/backend/file.rs to bail_coded!/err_coded! with their real STG-0xx codes, matched against the 27 documented codes in docs/ERROR_REFERENCE.md. - All 27 ErrorCode::StgNNN variants + REGISTRY entries added to src/error.rs. - docs/ERROR_REFERENCE.md's STG section "Error text" lines rewritten from one-off example values to canonical {}-placeholder templates so they byte-match REGISTRY (verified by the existing sync test). - FileBackend::open_with no longer collapses a more specific header-parse failure (e.g. bad magic number) into the generic STG-010: it now propagates an existing CodedError in the chain as-is, falling back to STG-010 only for a genuinely uncoded failure. - Two bail! sites with no matching documented STG code ("Header checksum mismatch", into_backend's multiple-owners precondition) deliberately left uncoded (INT-000) rather than assigned an undocumented code. - Regression tests: 6 integration tests against the public Minigraf::open() API (tests/error_codes_storage_test.rs) plus unit tests inside the storage modules for codes only reachable below the (crate-private) storage module boundary. Not covered by a dedicated test: STG-011 (guarded by a debug_assert! that always fires first under `cargo test`), the 8 arithmetic-overflow guards STG-017–024, and STG-027 (needs an unlockable filesystem no CI runner provides) — all three categories are documented as "should not occur under normal operation" and are covered by the registry↔doc sync test. toward #277 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P7e4uTBWtM8fMZiPZc4bCw * perf(error): shrink CodedError/ErrorCode binary-size footprint - Drop derive(Debug) on ErrorCode: with the registry growing to 130 variants across #277's six category PRs, the generated per-variant match arm is pure binary-size cost with no runtime use — nothing formats an ErrorCode with {:?}. - Hand-write CodedError's Debug impl instead of deriving it, reusing the already-formatted message and the stable code string rather than requiring ErrorCode: Debug. - Mark CodedError::new #[cold]/#[inline(never)]: error construction is the cold path at every bail_coded!/err_coded! call site (currently ~50, eventually ~250+), so keep the registry lookup + format_template call out of line instead of duplicating it inline per call site. Toward the binary-size pressure from #277 (see #367's raise of the CI budget from 1MB to ~1.2MB for the full context). Part of #277 --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
adityamukho
added a commit
that referenced
this pull request
Aug 25, 2026
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.
Summary
build_btree, commit 981d868) applies again — it doesn't.bail_coded!/err_coded!/format_templateare already non-generic (&[&dyn fmt::Display]), so there's no per-call-site monomorphization to cut.cargo bloatshows no single dominant symbol, just diffuse growth across ~2000 small functions.opt-level = "z",lto = true,codegen-units = 1,strip = "symbols") are already at their most aggressive settings.Raises
SIZE_LIMIT_BYTESin.github/workflows/binary-size.ymlfrom 1048576 (1 MiB) to 1228800 (1200 KiB), and updates the stated target inPHILOSOPHY.md§4 andCLAUDE.mdto match. This is a deliberate, user-approved deviation from the project's<1MBphilosophy goal — documented inCHANGELOG.md.Part of #277 (not a closing PR — does not close #277 or any of #358-#362).
Test plan
cargo test— 725 passed, 0 failedcargo clippy --all-features -- -D warnings— cleancargo fmt --check— clean🤖 Generated with Claude Code