8000 chore: raise binary-size CI budget from 1MB to ~1.2MB for #277 by adityamukho · Pull Request #367 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

chore: raise binary-size CI budget from 1MB to ~1.2MB for #277 - #367

Merged
adityamukho merged 1 commit into
mainfrom
binary-size-limit-277
Aug 25, 2026
Merged

adityamukho merged 1 commit into
mainfrom
binary-size-limit-277

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Summary

Raises SIZE_LIMIT_BYTES in .github/workflows/binary-size.yml from 1048576 (1 MiB) to 1228800 (1200 KiB), and updates the stated target in PHILOSOPHY.md §4 and CLAUDE.md to match. This is a deliberate, user-approved deviation from the project's <1MB philosophy goal — documented in CHANGELOG.md.

Part of #277 (not a closing PR — does not close #277 or any of #358-#362).

Test plan

  • cargo test — 725 passed, 0 failed
  • cargo clippy --all-features -- -D warnings — clean
  • cargo fmt --check — clean
  • Pre-push hook (fmt+clippy+test) passed

🤖 Generated with Claude Code

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
codecov Bot commented Aug 25, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 1c64a33 into main Aug 25, 2026
17 checks passed
@adityamukho
adityamukho deleted the binary-size-limit-277 branch August 25, 2026 19:35
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
…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>
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.

post-1.0: add structured error codes to runtime output

1 participant

0