Skip to content

AD on Julia 1.12: doubled Enzyme gradient through a symmetric sparse coupling, and the NoAdjoint table cut #1038

Done

Description

@seabbs-bot

Enzyme reverse gives twice the ForwardDiff gradient for a Symmetric(sparse(...)) coupling on Julia 1.12, and the NoAdjoint table-cut scenario fires the rule.
Both surfaced once the AD versions and Threads compat-floor legs moved from 1.11 to 1.12, because the 1.11 legs had been failing at instantiate since the floor change.

Suspected cause. The doubled gradient is in the "named container 2" test added with the silent plain-AD change: plain Enzyme reverse through Symmetric(sparse([θ[1] 0.1; 0.1 θ[2]])).
Both entries come out exactly doubled, which looks like the known Enzyme fault on a repeated sparse mul! in #964.
The table-cut failure is #1034, which has a fix on claude/noadjoint-table-cut with no PR yet.

Proposed fix.

Detail

AD versions run on the PR that moved the legs: https://github.com/EpiAware/ComposableRecurrences.jl/actions/runs/47212147077

  • enzyme_reverse rest (Julia 1.12): test/ad/adjoints.jl:2843, named container 2, evaluated [10.11322590378406, 30.130960633211775] ≈ [5.0566129518920295, 15.065480316605885].
  • enzyme_reverse registry (Julia 1.12) and mooncake_reverse registry (Julia 1.12): test/ad/checks.jl:122, "NoAdjoint Convolution lag contributions of a table cut at a report day: no rule fires", fired == rule evaluated true == false.
  • Threads ad (Julia 1.12, registry) also failed. GitHub returned 502 on its log, so its failure was not read; it runs the same registry compat_floor items, so it is likely the table-cut case.

The scheduled AD versions run on main of 30 November passed both 1.12 legs, before the plain-AD change and the table-cut scenario landed.

This was opened by a bot. Please ping @seabbs for any questions.

Activity

  1. seabbs-bot commented on Dec 4, 2026

    @seabbs-bot
    CollaboratorAuthor

    Both parts are fixed on main. The NoAdjoint table cut by #1049, and the doubled Enzyme gradient by #1052, which marks it broken on Julia 1.12 only because the bug is Enzyme's (reproducer on #931).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions