Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Problems with the `DEFINED_DIFFRULES` implementation

未关闭
#90 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

@devmotion 已经在做这个了。

开始于 2026年9月18日。

  • #120 来自 @devmotion —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
julia

调研方向

首先阅读 DiffRules.jl 中的 DEFINED_DIFFRULES 实现,以及内省入口 DiffRules.diffrules 和 DiffRules.hasdiffrule。调查 @define_diffule 在分别预编译的包和扩展中的行为;完成的标准是选择并记录一个向后兼容的设计,该设计能够处理外部规则和基于模块的访问。

由索引模型根据 Issue 内容生成。

描述

Many "introspection" functions in DiffRules like DiffRules.diffrules look at the global variable DEFINED_DIFFRULES to collect information about what diff rules are defined. I think this has some issues:

  • Only diff rules defined inside DiffRules.jl will be inside DEFINED_DIFFRULES. Packages that use @define_diffule will not be in that list. That is because side effects like adding to a global variable are not visible when modified during the time a package gets precompiled. You would have to add stuff to it in __init__ for it to be visible.
  • Accesses are made with a symbol as an argument, for example, DiffRules.hasdiffrule(:Base, :sin, 1). This feels to me like it should be made with a module as first argument.

I encounter this when I try to make e.g. LogExpFunctions into an extension (which makes it a separate module). I'm trying to think of ways to improve this that are backwards compatible.

主要语言
Julia
星标
74
派生
36
平均合并
1 天 1 小时
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaDiff/DiffRules.jl 的其他 Issue

查看 JuliaDiff/DiffRules.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。