JuliaDiff / JuliaDiff/ChainRulesCore.jl

Tracked DoesNotExist: so you know where it came from

Open
#263 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugging enhancement
Dominant language
Julia
Stars
267
Forks
66
PR merge metrics
No merged PRs in 30d

Description

This was a discussion i had with Mike Innes about a year back.
The problem with DoesNotExist() is that you really have no idea where it came from.
Which in turn makes erroring on doing things with it problematic.

We could replace it with a macro (and probably rename it at the same time, https://github.com/JuliaDiff/ChainRulesCore.jl/issues/262).
If debugmode is enables tha macro could replace every instance with one that uses the same trick we use in for Thunks to capture the source location into a field.
Or for (much) higher performance cost, we could capture the stacktrace.

This would solve the problem that people sometimes have in Zygote where they are like "where did this nothing come from?"

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

Start by locating the DoesNotExist entry point and read src/differentials/thunks.jl, especially the cited Thunks implementation. Compare the proposed debugmode macro and stacktrace approaches, then resolve the naming and performance design before defining tests that confirm source information is retained.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
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.