一键导入
find-bugs
Find bugs in asdex by testing edge cases against JAX's reference implementations. Use when asked to hunt for bugs, test edge cases, or verify correctness.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Find bugs in asdex by testing edge cases against JAX's reference implementations. Use when asked to hunt for bugs, test edge cases, or verify correctness.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | find-bugs |
| description | Find bugs in asdex by testing edge cases against JAX's reference implementations. Use when asked to hunt for bugs, test edge cases, or verify correctness. |
| allowed-tools | Bash(uv run python *) Bash(gh issue *) |
Test asdex functions against JAX reference implementations to find correctness bugs.
gh issue list --state openasdex.jacobian/asdex.hessian against jax.jacobian/jax.hessianNotImplementedError is raised:
a. Skip if it matches an open issue (no need to re-confirm known bugs)
b. For new bugs, minimize to an MWE and file an issue:
import jax
import jax.numpy as jnp
import asdex
def f(x):
return some_jax_operation(x)
x = jnp.array([...])
J_asdex = asdex.jacobian(f, x, output_format="dense")(x)
J_jax = jax.jacobian(f)(x)
assert jnp.allclose(J_asdex, J_jax)
Input/output combinations:
(1,0), non-contiguous (0,2), negative -1Save/load roundtrips:
SparsityPattern and ColoredPattern serializationPrimitives (check src/asdex/detection/_interpret/__init__.py _prop_dispatch):
cond, scan, while_loop, fori_loopgather, scatter, dynamic_slice, dynamic_update_slicereduce, reduce_window, reduce_max, reduce_minaxis=(), keepdims=True, partial axis subsetsclamp, select, select_nCheck if asdex detects exact sparsity (not overly conservative):
import numpy as np
pattern = asdex.jacobian_sparsity(f, x)
detected_nnz = pattern.nnz
J_jax = jax.jacobian(f)(x)
true_nnz = np.sum(np.abs(np.asarray(J_jax)) > 1e-10)
if detected_nnz > true_nnz:
print(f"Conservative pattern: detected {detected_nnz}, true {true_nnz}")
Conservative patterns are correct but suboptimal. Document these with a TODO(primitive) comment showing the precise expected pattern.
Note that asdex computes global sparisty patterns that must be valid over the entire input domain: https://adrianhill.de/asdex/explanation/global-sparsity/