Skip to content

Enzyme Segfault#433

Merged
ptiede merged 5 commits intomainfrom
ptiede-fixeltype
Dec 9, 2025
Merged

Enzyme Segfault#433
ptiede merged 5 commits intomainfrom
ptiede-fixeltype

Conversation

@ptiede
Copy link
Owner

@ptiede ptiede commented Dec 9, 2025

No description provided.

@ptiede
Copy link
Owner Author

ptiede commented Dec 9, 2025

Ok the newest version of TransformVariables has broken things. When I try to update Enzyme segfaults. I am going to place a version limit but I really do need to make that Enzyme integration test.

This is actually really bad now. It isn't TransformVariables or any of the dependencies I can figure out. I am very stuck ast this point in terms of what caused this. @wsmoses could this be from Enzyme_jll 0.0.228?

It is from Enzyme 0.13.105

@ptiede ptiede changed the title Fix inverse_eltype Enzyme Segfault Dec 9, 2025
@ptiede
Copy link
Owner Author

ptiede commented Dec 9, 2025

OK, looking into this, we break at Enzyme 0.13.105. The code in question is

 _, _, _, lcamp, cphase = load_data()
 
 function test_model(θ, meta)
    m1 = θ.f1 * rotated(stretched(Gaussian(), θ.σ1 * θ.τ1, θ.σ1), θ.ξ1)
    m2 = θ.f2 * rotated(stretched(Gaussian(), θ.σ2 * θ.τ2, θ.σ2), θ.ξ2)
    return m1 + shifted(m2, θ.x, θ.y)
end

function test_prior()
    return (
        f1 = Uniform(0.8, 1.2),
        σ1 = Uniform(μas2rad(1.0), μas2rad(40.0)),
        τ1 = Uniform(0.35, 0.65),
        ξ1 = Uniform(-π / 2, π / 2),
        f2 = Uniform(0.3, 0.7),
        σ2 = Uniform(μas2rad(1.0), μas2rad(40.0)),
        τ2 = Uniform(0.35, 0.65),
        ξ2 = Uniform(-π / 2, π / 2),
        x = Uniform(-μas2rad(40.0), μas2rad(40.0)),
        y = Uniform(-μas2rad(40.0), μas2rad(40.0)),
    )
end

 
g = imagepixels(μas2rad(150.0), μas2rad(150.0), 256, 256)
skym = SkyModel(test_model, test_prior(), g)
post = VLBIPosterior(skym, lcamp, cphase; admode = set_runtime_activity(Enzyme.Reverse))

tpost = asflat(post)
x = prior_sample(tpost)
dx = zero(x)

autodiff(set_runtime_activity(Reverse), logdensityof, Const(tpost), Duplicated(x, dx)))

I am booked until Wednesday afternoon, so I can try to find a real MWE then.

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.37%. Comparing base (b729fa3) to head (44ee230).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #433   +/-   ##
=======================================
  Coverage   88.37%   88.37%           
=======================================
  Files          40       40           
  Lines        2451     2451           
=======================================
  Hits         2166     2166           
  Misses        285      285           

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

@ptiede ptiede merged commit 7a0dff2 into main Dec 9, 2025
7 of 8 checks passed
@ptiede ptiede deleted the ptiede-fixeltype branch December 9, 2025 07:54
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.

1 participant