Skip to content

Conversation

@vchuravy
Copy link
Member

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2025

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

Click here to view the suggested changes.
diff --git a/src/analyses/activity.jl b/src/analyses/activity.jl
index 23f59d8..56c6eb6 100644
--- a/src/analyses/activity.jl
+++ b/src/analyses/activity.jl
@@ -382,9 +382,9 @@ Base.@nospecializeinfer @inline function active_reg_inner(
     return ty
 end
 
-function active_reg_cached(ctx::EnzymeContext, @nospecialize(ST::Type); justActive=false, UnionSret = false, AbstractIsMixed = false)
+function active_reg_cached(ctx::EnzymeContext, @nospecialize(ST::Type); justActive = false, UnionSret = false, AbstractIsMixed = false)
     key = (ST, justActive, UnionSret, AbstractIsMixed)
-    get!(ctx.activity_cache, key) do
+    return get!(ctx.activity_cache, key) do
         set = Base.IdSet{Type}()
         active_reg_inner(ST, set, ctx.world, justActive, UnionSret, AbstractIsMixed)
     end
diff --git a/src/compiler.jl b/src/compiler.jl
index 48b7b72..ab87a1d 100644
--- a/src/compiler.jl
+++ b/src/compiler.jl
@@ -50,14 +50,14 @@ using Printf
 end
 
 @inline function Base.:|(a1::ActivityState, a2::ActivityState)
-    ActivityState(Int(a1) | Int(a2))
+    return ActivityState(Int(a1) | Int(a2))
 end
 
 mutable struct EnzymeContext
     world::UInt
-    activity_cache::Dict{Tuple{Type,Bool,Bool,Bool},ActivityState}
+    activity_cache::Dict{Tuple{Type, Bool, Bool, Bool}, ActivityState}
     function EnzymeContext(world)
-        new(world, Dict{Tuple{Type,Bool,Bool,Bool},ActivityState}())
+        return new(world, Dict{Tuple{Type, Bool, Bool, Bool}, ActivityState}())
     end
 end
 
@@ -3301,7 +3301,7 @@ function create_abi_wrapper(
         # 3 is index of shadow
         if existed[3] != 0 &&
            sret_union &&
-           active_reg_cached(interp.context, pactualRetType; justActive=true, UnionSret=true) == ActiveState
+                active_reg_cached(interp.context, pactualRetType; justActive = true, UnionSret = true) == ActiveState
             rewrite_union_returns_as_ref(enzymefn, data[3], world, width)
         end
         returnNum = 0
diff --git a/src/compiler/interpreter.jl b/src/compiler/interpreter.jl
index f6f8a4d..d571cd2 100644
--- a/src/compiler/interpreter.jl
+++ b/src/compiler/interpreter.jl
@@ -281,8 +281,9 @@ function EnzymeInterpreter(interp::EnzymeInterpreter;
     inactive_rules = interp.inactive_rules,
     broadcast_rewrite = interp.broadcast_rewrite,
     within_autodiff_rewrite = interp.within_autodiff_rewrite,
-    handler = interp.handler,
-    context = interp.context,)
+        handler = interp.handler,
+        context = interp.context,
+    )
     @assert context.world == world
     return EnzymeInterpreter(
         cache_or_token,

@github-actions
Copy link
Contributor

Benchmark Results

main d15d98d... main / d15d98d...
basics/make_zero/namedtuple 0.051 ± 0.0014 μs 0.0524 ± 0.0015 μs 0.974 ± 0.039
basics/make_zero/struct 0.256 ± 0.0051 μs 0.264 ± 0.0053 μs 0.969 ± 0.027
basics/overhead 5.25 ± 0.011 ns 4.34 ± 0.01 ns 1.21 ± 0.0038
basics/remake_zero!/namedtuple 0.316 ± 0.0042 μs 0.318 ± 0.0049 μs 0.995 ± 0.02
basics/remake_zero!/struct 0.299 ± 0.0075 μs 0.3 ± 0.0072 μs 0.997 ± 0.034
time_to_load 1.27 ± 0.008 s 1.32 ± 0.013 s 0.964 ± 0.011

Benchmark Plots

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

@codecov
Copy link

codecov bot commented Sep 22, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.20%. Comparing base (cffa09d) to head (d15d98d).

Files with missing lines Patch % Lines
src/compiler.jl 77.77% 2 Missing ⚠️
src/compiler/interpreter.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           revert-2594-acache    #2612   +/-   ##
===================================================
  Coverage               75.20%   75.20%           
===================================================
  Files                      56       56           
  Lines                   17711    17719    +8     
===================================================
+ Hits                    13319    13326    +7     
- Misses                   4392     4393    +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.

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