Skip to content

fix: restore Diffractor support on Julia 1.10 and 1.11 - #1079

Closed
gdalle-bot wants to merge 1 commit into
JuliaDiff:mainfrom
gdalle-bot:fix/diffractor
Closed

gdalle-bot wants to merge 1 commit into
JuliaDiff:mainfrom
gdalle-bot:fix/diffractor

Conversation

@gdalle-bot

@gdalle-bot gdalle-bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

This PR was generated by a coding agent, please disregard it until @gdalle has reviewed it.

Restore AutoDiffractor support, which has been frozen at Diffractor v0.2.6 and untested in CI.

Diagnosis

Two independent problems:

  1. Broadcasting bug in Diffractor v0.2.7 to v0.2.10 (New release broke DifferentiationInterface Diffractor.jl#290). The forward broadcast rule in src/stage1/broadcast.jl calls FwdMap{E}(f), but the only constructor is FwdMap{N,E}(f). So E = false lands in the N slot and we get MethodError: no method matching (FwdMap{false, E, T} where ...). Any f.(x) fails; map and scalar code are fine. The typo is still present on Diffractor main.
  2. Registered Diffractor does not load on Julia 1.12: v0.2.10 fails to precompile there (method overwriting of copy(::IRCode)). Diffractor main (unreleased v0.2.11) does not load on 1.12 either (MethodList has no field mt), though it does on 1.13-rc3. DI cannot fix this.

Changes

  • Extension: define the missing Diffractor.FwdMap{E}(f) constructor. This is type piracy, flagged as such in the code and docs; it is safe because compat is pinned to a single Diffractor version.
  • Compat: Diffractor = "=0.2.6" → "=0.2.10".
  • Tests: recreate the Diffractor backend test group (same scenarios as before its removal in chore: revamp testing CI with dedicated environments #926, plus a non-regression test for broadcasting) and reactivate it in CI on Julia 1.10 only (the matrix is 1.10 / 1.12 / 1.13, and the last two are excluded for this group).
  • Docs, README, changelog updated to say that Diffractor works on Julia 1.10 and 1.11 only.

Testing

Draft PRs skip Julia 1.10 in CI, so the Diffractor group does not run here until the PR is marked ready. Ran the group locally: 3425/3425 tests pass on both Julia 1.10.11 and 1.11.9.

Possible follow-up

A one-line upstream PR to Diffractor (FwdMap{E} → FwdMap{N,E}) would let us drop the piracy once released.

Generated with Claude Opus 5.5 (claude-opus-5-5).

🤖 Generated with Claude Code

https://claude.ai/code/session_017t9zghYPb67WRAZPDhMCNt

Work around the broadcasting bug of Diffractor v0.2.7 to v0.2.10 (JuliaDiff/Diffractor.jl#290) by defining the missing `FwdMap{E}` constructor in the extension. Bump the compat bound to v0.2.10 and reactivate the Diffractor test group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017t9zghYPb67WRAZPDhMCNt
@gdalle

gdalle commented Oct 12, 2026

Copy link
Copy Markdown
Member

Okay this is actually useless, nevermind

@gdalle gdalle closed this Oct 12, 2026
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.92%. Comparing base (e068471) to head (11bf04e).

Files with missing lines Patch % Lines
...ractorExt/DifferentiationInterfaceDiffractorExt.jl 0.00% 2 Missing ⚠️
...ferentiationInterface/test/Back/Diffractor/test.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1079       +/-   ##
===========================================
+ Coverage   60.79%   93.92%   +33.13%     
===========================================
  Files         137      141        +4     
  Lines        8111     8197       +86     
===========================================
+ Hits         4931     7699     +2768     
+ Misses       3180      498     -2682     
Flag Coverage Δ
DI 94.54% <0.00%> (+47.71%) ⬆️
DIT 92.20% <ø> (-6.29%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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