Skip to content

[codex] Enable debug assertions in release test builds#917

Open
saulshanabrook wants to merge 2 commits into
egraphs-good:mainfrom
saulshanabrook:debug-assertions-release-tests
Open

[codex] Enable debug assertions in release test builds#917
saulshanabrook wants to merge 2 commits into
egraphs-good:mainfrom
saulshanabrook:debug-assertions-release-tests

Conversation

@saulshanabrook

@saulshanabrook saulshanabrook commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

Release-mode test targets now enable debug assertions through the Cargo profile environment override CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS=true.

This applies to:

  • make test
  • make coverage
  • make doctest

Normal release builds and CodSpeed benchmark jobs continue to use the standard release profile, so debug assertions remain disabled for benchmark and production release artifacts.

Added because we missed a bug recently that would have been found if we had enabled these in testing in CI.

It doesn't seem to slow things down too much, like from 8 minutes to 9 minutes.

Validation

  • cargo test --release -p egglog-core-relations --lib bad_offset -- --list
    • confirmed a plain release build lists 0 tests for #[cfg(debug_assertions)] tests
  • CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS=true cargo test --release -p egglog-core-relations --lib bad_offset
    • confirmed release-mode test builds with the override execute the debug assertions
  • CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS=true cargo insta test --test-runner nextest --release --workspace --unreferenced ignore -- math
  • make -n test coverage doctest
  • git diff --check

@saulshanabrook saulshanabrook marked this pull request as ready for review June 5, 2026 06:50
@saulshanabrook saulshanabrook requested a review from a team as a code owner June 5, 2026 06:50
@saulshanabrook saulshanabrook requested review from ezrosent and removed request for a team June 5, 2026 06:50
@saulshanabrook

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@saulshanabrook saulshanabrook requested review from oflatt and removed request for ezrosent June 5, 2026 06:50
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a single configuration line to enable debug assertions in the release build profile. This change allows debug assertion checks to remain active even when building optimized release binaries, rather than being stripped out by default.

Changes

Release Profile Configuration

Layer / File(s) Summary
Debug assertions in release profile
Cargo.toml
The [profile.release] section is updated to enable debug-assertions = true, ensuring debug assertions remain active in release builds.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main change: enabling debug assertions in release builds via Cargo.toml configuration.
Description check ✅ Passed The pull request description clearly explains the change: enabling debug assertions in release-mode test builds via a Cargo profile setting, with specific validation steps and rationale.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq

codspeed-hq Bot commented Jun 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 216 skipped benchmarks1


Comparing saulshanabrook:debug-assertions-release-tests (894b9ba) with main (f0da95b)

Open in CodSpeed

Footnotes

  1. 216 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@saulshanabrook saulshanabrook changed the title [codex] Enable debug assertions in release builds [codex] Enable debug assertions in release test builds Jun 5, 2026
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.

2 participants