Skip to content

Add f64 exp, log, and sqrt primitives#834

Open
saulshanabrook wants to merge 4 commits intoegraphs-good:mainfrom
saulshanabrook:codex/f64-unary-primitives
Open

Add f64 exp, log, and sqrt primitives#834
saulshanabrook wants to merge 4 commits intoegraphs-good:mainfrom
saulshanabrook:codex/f64-unary-primitives

Conversation

@saulshanabrook
Copy link
Copy Markdown
Member

@saulshanabrook saulshanabrook commented Mar 26, 2026

  • add exp, log, and sqrt as f64 primitives
  • expose them through the existing f64 sort implementation
  • add egg tests for the new operations, including direct failure cases for invalid domain inputs

@saulshanabrook saulshanabrook requested a review from a team as a code owner March 26, 2026 19:09
@saulshanabrook saulshanabrook requested review from FTRobbin and Copilot and removed request for a team March 26, 2026 19:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new floating-point math primitives (exp, log, sqrt) to the existing f64 sort so they can be used directly in egglog programs, and extends the f64 egg tests to cover both valid and invalid-domain evaluations.

Changes:

  • Register exp, log, and sqrt as f64 literal primitives (with domain checks for log and sqrt).
  • Extend tests/f64.egg with passing checks for the new ops and fail cases for invalid inputs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/sort/f64.rs Registers exp, log, sqrt primitives for the f64 sort and updates the sort’s primitive list documentation.
tests/f64.egg Adds egg tests validating correct results and expected failures for invalid domains.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 26, 2026

Merging this PR will not alter performance

✅ 36 untouched benchmarks
⏩ 192 skipped benchmarks1


Comparing saulshanabrook:codex/f64-unary-primitives (6b6a5ea) with main (21bd8c6)

Open in CodSpeed

Footnotes

  1. 192 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.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.15%. Comparing base (114692b) to head (6b6a5ea).
⚠️ Report is 34 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #834   +/-   ##
=======================================
  Coverage   82.14%   82.15%           
=======================================
  Files          88       88           
  Lines       24867    24874    +7     
=======================================
+ Hits        20428    20434    +6     
- Misses       4439     4440    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants