Skip to content

Conversation

@mtfishman
Copy link
Member

Some Zygote AD tests are segfaulting in Julia v1.12. I'd still like to narrow down which tests are leading to segfaults so we can still run the other ones.

Maybe related to:

@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2025

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/test/ext/ITensorMPSChainRulesCoreExt/test_chainrules.jl b/test/ext/ITensorMPSChainRulesCoreExt/test_chainrules.jl
index b563f08..10e3635 100644
--- a/test/ext/ITensorMPSChainRulesCoreExt/test_chainrules.jl
+++ b/test/ext/ITensorMPSChainRulesCoreExt/test_chainrules.jl
@@ -293,49 +293,49 @@ Random.seed!(1234)
     @test f(y) ≈ g(y_itensor)
     @test contract(f'(y)) ≈ g'(y_itensor)
 
-    # These tests are broken in Julia v1.12. See:
-    # https://github.com/ITensor/ITensorMPS.jl/pull/161
-    # https://github.com/JuliaLang/julia/issues/59138
-    # https://github.com/FluxML/Zygote.jl/issues/1580
-    if VERSION ≤ v"1.12-"
-      f =
-        x ->
-          inner(replaceprime(contract(x, y), 2 => 1), replaceprime(contract(x, y), 2 => 1))
-      g =
-        x -> inner(
-          replaceprime(contract(x, y_itensor), 2 => 1),
-          replaceprime(contract(x, y_itensor), 2 => 1),
-        )
-      @test f(x) ≈ g(x_itensor)
-      @test contract(f'(x)) ≈ g'(x_itensor)
-
-      f =
-        y ->
-          inner(replaceprime(contract(x, y), 2 => 1), replaceprime(contract(x, y), 2 => 1))
-      g =
-        y -> inner(
-          replaceprime(contract(x_itensor, y), 2 => 1),
-          replaceprime(contract(x_itensor, y), 2 => 1),
-        )
-      @test f(y) ≈ g(y_itensor)
-      @test contract(f'(y)) ≈ g'(y_itensor)
-
-      f = x -> inner(replaceprime(*(x, y), 2 => 1), replaceprime(*(x, y), 2 => 1))
-      g =
-        x -> inner(
-          replaceprime(*(x, y_itensor), 2 => 1), replaceprime(*(x, y_itensor), 2 => 1)
-        )
-      @test f(x) ≈ g(x_itensor)
-      @test contract(f'(x)) ≈ g'(x_itensor)
-
-      f = y -> inner(replaceprime(*(x, y), 2 => 1), replaceprime(*(x, y), 2 => 1))
-      g =
-        y -> inner(
-          replaceprime(*(x_itensor, y), 2 => 1), replaceprime(*(x_itensor, y), 2 => 1)
-        )
-      @test f(y) ≈ g(y_itensor)
-      @test contract(f'(y)) ≈ g'(y_itensor)
-    end
+        # These tests are broken in Julia v1.12. See:
+        # https://github.com/ITensor/ITensorMPS.jl/pull/161
+        # https://github.com/JuliaLang/julia/issues/59138
+        # https://github.com/FluxML/Zygote.jl/issues/1580
+        if VERSION ≤ v"1.12-"
+            f =
+                x ->
+            inner(replaceprime(contract(x, y), 2 => 1), replaceprime(contract(x, y), 2 => 1))
+            g =
+                x -> inner(
+                replaceprime(contract(x, y_itensor), 2 => 1),
+                replaceprime(contract(x, y_itensor), 2 => 1),
+            )
+            @test f(x) ≈ g(x_itensor)
+            @test contract(f'(x)) ≈ g'(x_itensor)
+
+            f =
+                y ->
+            inner(replaceprime(contract(x, y), 2 => 1), replaceprime(contract(x, y), 2 => 1))
+            g =
+                y -> inner(
+                replaceprime(contract(x_itensor, y), 2 => 1),
+                replaceprime(contract(x_itensor, y), 2 => 1),
+            )
+            @test f(y) ≈ g(y_itensor)
+            @test contract(f'(y)) ≈ g'(y_itensor)
+
+            f = x -> inner(replaceprime(*(x, y), 2 => 1), replaceprime(*(x, y), 2 => 1))
+            g =
+                x -> inner(
+                replaceprime(*(x, y_itensor), 2 => 1), replaceprime(*(x, y_itensor), 2 => 1)
+            )
+            @test f(x) ≈ g(x_itensor)
+            @test contract(f'(x)) ≈ g'(x_itensor)
+
+            f = y -> inner(replaceprime(*(x, y), 2 => 1), replaceprime(*(x, y), 2 => 1))
+            g =
+                y -> inner(
+                replaceprime(*(x_itensor, y), 2 => 1), replaceprime(*(x_itensor, y), 2 => 1)
+            )
+            @test f(y) ≈ g(y_itensor)
+            @test contract(f'(y)) ≈ g'(y_itensor)
+        end
   end
   @testset "Calling apply multiple times (ITensors #924 regression test)" begin
     n = 1

@codecov
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.28%. Comparing base (e9650e5) to head (dc8480a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #161   +/-   ##
=======================================
  Coverage   90.28%   90.28%           
=======================================
  Files          54       54           
  Lines        3583     3583           
=======================================
  Hits         3235     3235           
  Misses        348      348           
Flag Coverage Δ
docs 18.01% <ø> (-0.44%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@mtfishman mtfishman changed the title [WIP] Skip broken Zygote tests in Julia v1.12 Skip broken Zygote tests in Julia v1.12 Oct 13, 2025
@mtfishman mtfishman marked this pull request as ready for review October 13, 2025 14:48
@mtfishman mtfishman merged commit 1519456 into main Oct 13, 2025
13 of 14 checks passed
@mtfishman mtfishman deleted the mf/julia-1.12 branch October 13, 2025 15:50
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