Skip to content

Conversation

@kshyatt
Copy link
Collaborator

@kshyatt kshyatt commented Jan 27, 2026

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic main) to apply these changes.

Click here to view the suggested changes.
diff --git a/src/internal_rules/bigfloat.jl b/src/internal_rules/bigfloat.jl
index 84d4478a..59bda768 100644
--- a/src/internal_rules/bigfloat.jl
+++ b/src/internal_rules/bigfloat.jl
@@ -67,19 +67,19 @@ function EnzymeRules.reverse(
     return ()
 end
 
-EnzymeRules.@easy_rule(+(a::BigFloat, b::Number), (1,1))
-EnzymeRules.@easy_rule(+(a::Number, b::BigFloat), (1,1))
+EnzymeRules.@easy_rule(+(a::BigFloat, b::Number), (1, 1))
+EnzymeRules.@easy_rule(+(a::Number, b::BigFloat), (1, 1))
 EnzymeRules.@easy_rule(+(a::BigFloat, b::BigFloat), (1,1))
-EnzymeRules.@easy_rule(-(a::BigFloat, b::Number), (1,-1))
-EnzymeRules.@easy_rule(-(a::Number, b::BigFloat), (1,-1))
+EnzymeRules.@easy_rule(-(a::BigFloat, b::Number), (1, -1))
+EnzymeRules.@easy_rule(-(a::Number, b::BigFloat), (1, -1))
 EnzymeRules.@easy_rule(-(a::BigFloat, b::BigFloat), (1,-1))
 EnzymeRules.@easy_rule(*(a::BigFloat, b::BigFloat), (b, a))
 EnzymeRules.@easy_rule(*(a::BigFloat, b::Number), (b, a))
 EnzymeRules.@easy_rule(*(a::Number, b::BigFloat), (b, a))
-EnzymeRules.@easy_rule(/(a::BigFloat, b::Number), (one(a)/b, -(a/b^2)))
-EnzymeRules.@easy_rule(/(a::Number, b::BigFloat), (one(a)/b, -(a/b^2)))
-EnzymeRules.@easy_rule(/(a::BigFloat, b::BigFloat), (one(a)/b, -(a/b^2)))
-EnzymeRules.@easy_rule(Base.inv(a::BigFloat), (-(one(a)/a^2),))
+EnzymeRules.@easy_rule(/(a::BigFloat, b::Number), (one(a) / b, -(a / b^2)))
+EnzymeRules.@easy_rule(/(a::Number, b::BigFloat), (one(a) / b, -(a / b^2)))
+EnzymeRules.@easy_rule(/(a::BigFloat, b::BigFloat), (one(a) / b, -(a / b^2)))
+EnzymeRules.@easy_rule(Base.inv(a::BigFloat), (-(one(a) / a^2),))
 EnzymeRules.@easy_rule(Base.sin(a::BigFloat), (cos(a),))
 EnzymeRules.@easy_rule(Base.cos(a::BigFloat), (-sin(a),))
 EnzymeRules.@easy_rule(Base.tan(a::BigFloat), (one(a) + Ω^2,))
diff --git a/test/rules/internal_rules/bigfloat.jl b/test/rules/internal_rules/bigfloat.jl
index c1818477..65a3bee2 100644
--- a/test/rules/internal_rules/bigfloat.jl
+++ b/test/rules/internal_rules/bigfloat.jl
@@ -13,17 +13,17 @@ using Test
     bf64 = 0.56 # for testing mixed methods
     dbf64 = 0.27 # for testing mixed methods
 
-    @test autodiff(Enzyme.Forward, +, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ da+db 
-    @test autodiff(Enzyme.Forward, +, Duplicated, Duplicated(a, da), Duplicated(bf64, dbf64))[:1] ≈ da+dbf64 
-    @test autodiff(Enzyme.Forward, -, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ da-db 
-    @test autodiff(Enzyme.Forward, -, Duplicated, Duplicated(a, da), Duplicated(bf64, dbf64))[:1] ≈ da-dbf64 
-    @test autodiff(Enzyme.Forward, *, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ b*da + a*db 
-    @test autodiff(Enzyme.Forward, *, Duplicated, Duplicated(a, da), Duplicated(bf64, dbf64))[:1] ≈ bf64*da + a*dbf64
-    @test autodiff(Enzyme.Forward, /, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ da/b  - db * a/b^2
-    @test autodiff(Enzyme.Forward, /, Duplicated, Duplicated(a, da), Duplicated(bf64, dbf64))[:1] ≈ da/bf64 - dbf64 * a/bf64^2 
+    @test autodiff(Enzyme.Forward, +, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ da + db
+    @test autodiff(Enzyme.Forward, +, Duplicated, Duplicated(a, da), Duplicated(bf64, dbf64))[:1] ≈ da + dbf64
+    @test autodiff(Enzyme.Forward, -, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ da - db
+    @test autodiff(Enzyme.Forward, -, Duplicated, Duplicated(a, da), Duplicated(bf64, dbf64))[:1] ≈ da - dbf64
+    @test autodiff(Enzyme.Forward, *, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ b * da + a * db
+    @test autodiff(Enzyme.Forward, *, Duplicated, Duplicated(a, da), Duplicated(bf64, dbf64))[:1] ≈ bf64 * da + a * dbf64
+    @test autodiff(Enzyme.Forward, /, Duplicated, Duplicated(a, da), Duplicated(b, db))[:1] ≈ da / b - db * a / b^2
+    @test autodiff(Enzyme.Forward, /, Duplicated, Duplicated(a, da), Duplicated(bf64, dbf64))[:1] ≈ da / bf64 - dbf64 * a / bf64^2
 
-    @test autodiff(Enzyme.Forward, inv, Duplicated, Duplicated(a, da))[:1] ≈ -(one(BigFloat)/a^2) * da
+    @test autodiff(Enzyme.Forward, inv, Duplicated, Duplicated(a, da))[:1] ≈ -(one(BigFloat) / a^2) * da
     @test autodiff(Enzyme.Forward, sin, Duplicated, Duplicated(a, da))[:1] ≈ cos(a) * da
-    @test autodiff(Enzyme.Forward, cos, Duplicated, Duplicated(a, da))[:1] ≈ -sin(a) * da 
+    @test autodiff(Enzyme.Forward, cos, Duplicated, Duplicated(a, da))[:1] ≈ -sin(a) * da
     @test autodiff(Enzyme.Forward, tan, Duplicated, Duplicated(a, da))[:1] ≈ autodiff(Enzyme.Forward, tan, Duplicated, Duplicated(af64, daf64))[1]
 end

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.87%. Comparing base (179b608) to head (176f1e8).
⚠️ Report is 2 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (179b608) and HEAD (176f1e8). Click for more details.

HEAD has 21 uploads less than BASE
Flag BASE (179b608) HEAD (176f1e8)
26 5
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2934       +/-   ##
===========================================
- Coverage   66.76%   50.87%   -15.89%     
===========================================
  Files          65       13       -52     
  Lines       21522     1256    -20266     
===========================================
- Hits        14369      639    -13730     
+ Misses       7153      617     -6536     

☔ 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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

Benchmark Results

main 0351f05... main / 0351f05...
basics/make_zero/namedtuple 0.0539 ± 0.003 μs 0.0536 ± 0.0022 μs 1 ± 0.069
basics/make_zero/struct 0.289 ± 0.0059 μs 0.279 ± 0.0049 μs 1.04 ± 0.028
basics/overhead 4.64 ± 0.01 ns 4.34 ± 0.01 ns 1.07 ± 0.0034
basics/remake_zero!/namedtuple 0.224 ± 0.0069 μs 0.225 ± 0.0077 μs 0.994 ± 0.046
basics/remake_zero!/struct 0.228 ± 0.009 μs 0.228 ± 0.01 μs 1 ± 0.06
fold_broadcast/multidim_sum_bcast/1D 10.2 ± 0.26 μs 10.3 ± 0.34 μs 0.997 ± 0.042
fold_broadcast/multidim_sum_bcast/2D 12.1 ± 0.45 μs 12.1 ± 0.24 μs 1 ± 0.042
time_to_load 1.05 ± 0.016 s 1.05 ± 0.019 s 0.996 ± 0.023

Benchmark Plots

A plot of the benchmark results has been uploaded as an artifact at https://github.com/EnzymeAD/Enzyme.jl/actions/runs/21907830982/artifacts/5466672695.

@kshyatt
Copy link
Collaborator Author

kshyatt commented Jan 28, 2026

Added some more arithmetic as a lark. The easy rule formulae match what Symbolics gives (thank you @vchuravy for checking) so I am very confused by why test_forward is failing

@kshyatt
Copy link
Collaborator Author

kshyatt commented Feb 3, 2026

I think the CUDA stuff is unrelated, the windows fail might be pertinent though

@wsmoses wsmoses merged commit dbdcad5 into main Feb 12, 2026
60 of 68 checks passed
@wsmoses wsmoses deleted the ksh/big_div branch February 12, 2026 01:33
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