JuliaDiff / JuliaDiff/Diffractor.jl

3 statement switches

Open
#157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactoring
Dominant language
Julia
Stars
453
Forks
33
PR merge metrics
No merged PRs in 30d

Description

This is a minor annoyance for maintenance. Which complicates things when you realize that the IR has encountered something unexpected, or is doing something wrong, you need to look in 3 places.

These are each basically big switch statements, that decide how to AD particular IR statments

It seems like we should only have 2.
That we can perhaps collapse forward as a special case of Forward-Demand where you demand everything or some such.

But they are not trivial to collapse.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the three switch statements linked in src/codegen/reverse.jl, src/codegen/forward.jl, and src/codegen/forward_demand.jl, starting with the listed line ranges. Determine whether Forward can be represented as a special case of Forward-Demand without losing behavior. Done means reducing the duplicated switches to two while preserving the existing IR differentiation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.