Skip to content

Mark the chunked Enzyme gradients of two draws on one pool broken under coverage on Julia 1.13 - #1060

Merged
seabbs merged 1 commit into
mainfrom
fix/1042-chunked-enzyme-coverage
Dec 4, 2026
Merged

seabbs merged 1 commit into
mainfrom
fix/1042-chunked-enzyme-coverage

Conversation

@seabbs-bot

Copy link
Copy Markdown
Collaborator

Closes #1042.
With code coverage on Julia 1.13, Enzyme fails on the chunked and stepped gradients of one scenario, an upstream bug already recorded as item 7 of #931.
This marks those two checks broken only in that case, so an unexpected pass still fails.

Claude Opus 5.5 [high]

Failure. In the Enzyme reverse AD job, the item "The gradient of a run in chunks, or advanced a step at a time, equals that of the single run" fails for "Recurrence two draws on one pool with a flow between" with IllegalTypeAnalysisException.

Cause. This is #931 item 7.
Under coverage, Julia 1.13 emits a one-byte load of the Share flag from a private constant, and Enzyme's type analysis rejects it.
ADFixtures.backend_broken_scenarios already marks the scenario's NoAdjoint twin broken for this reason.
The chunked wrapper also takes plain AD of the operator, so it meets the same bug.

Fix. test/ad/chunked.jl takes each chunked and stepped gradient inside its @test, with broken = true when all of these hold: the backend is Enzyme reverse, the scenario is this one, coverage is on (ADFixtures._coverage()), and Julia is 1.13 or newer.
An error then counts as broken there, and an unexpected pass fails the item.
Every other backend and scenario is tested as before.

Evidence (local, Julia 1.13.4, Enzyme 0.13).
A script with the ChunkedRuns snippet and this one scenario, under Enzyme reverse:

  • --code-coverage=@. (as the AD job runs): the whole-run gradient works, and the chunked(3) and stepped gradients both raise IllegalTypeAnalysisException.
  • No coverage: both match the whole-run gradient.

The item itself, Enzyme reverse only (enzyme_reverse argument) under --code-coverage=@. on Julia 1.13.4: 44 passed and 2 broken (the chunked and stepped checks of this scenario), in 17 min.
Without coverage the broken flag is false, so the item runs as before.

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

…er coverage on Julia 1.13

With code coverage on Julia 1.13, Enzyme's type analysis rejects the
chunked and stepped runs of this scenario, item 7 of #931, as it does for
the scenario's NoAdjoint twin. Each gradient is taken inside its test, so
the error counts as broken there and an unexpected pass still fails.
Closes #1042.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seabbs-bot
seabbs-bot requested a review from seabbs as a code owner December 4, 2026 20:46
@seabbs
seabbs merged commit 30bcc63 into main Dec 4, 2026
4 of 13 checks passed
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.

Enzyme reverse fails type analysis on a chunked run with two draws when coverage is on

2 participants