一键导入
jax-equinox-numerics
Use for any JAX + Equinox numerics project; repo-agnostic patterns plus companion checklists to align with local style.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use for any JAX + Equinox numerics project; repo-agnostic patterns plus companion checklists to align with local style.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | jax-equinox-numerics |
| description | Use for any JAX + Equinox numerics project; repo-agnostic patterns plus companion checklists to align with local style. |
| metadata | {"short-description":"JAX/Equinox numerics"} |
Guidance for software engineering practices around numerical/JAX codebases using JAX + Equinox + Lineax + Optimistix.
This file is the entrypoint. Keep it lightweight and load focused references for implementation details.
Apply these checklists when using this skill.
checklists/jax_equinox_design_checklist.mdchecklists/jit_static_pytree_checklist.mdchecklists/numerics_ad_testing_checklist.mdchecklists/linear_algebra_checklist.mdscripts/install_skills_with_assets.sh)~/.codex/skills/assets/checklists/jax_equinox_design_checklist.md~/.codex/skills/assets/checklists/jit_static_pytree_checklist.md~/.codex/skills/assets/checklists/numerics_ad_testing_checklist.md~/.codex/skills/assets/checklists/linear_algebra_checklist.mdUse these snippets as implementation starters when they match the task.
snippets/jit_boundary.pysnippets/partition_static_state.pysnippets/filter_vmap_batching.pysnippets/prng_split_by_tree.pysnippets/filter_cond_static.pysnippets/linear_operator_pattern.pysnippets/custom_jvp_norm.pysnippets/implicit_jvp.pysnippets/test_jvp_finite_difference.pysnippets/abc_module_pattern.pyscripts/install_skills_with_assets.sh)~/.codex/skills/assets/snippets/jit_boundary.py~/.codex/skills/assets/snippets/partition_static_state.py~/.codex/skills/assets/snippets/filter_vmap_batching.py~/.codex/skills/assets/snippets/prng_split_by_tree.py~/.codex/skills/assets/snippets/filter_cond_static.py~/.codex/skills/assets/snippets/linear_operator_pattern.py~/.codex/skills/assets/snippets/custom_jvp_norm.py~/.codex/skills/assets/snippets/implicit_jvp.py~/.codex/skills/assets/snippets/test_jvp_finite_difference.py~/.codex/skills/assets/snippets/abc_module_pattern.pyeqx.filter_jit/jax.jit.eqx.Module with abc.abstractmethod or eqx.AbstractVar.eqx.Module with no further overrides or subclassing.to_jax() and np.asarray(...) where values are assigned into arrays).jit/vmap/scan or core solver internals.jit/vmap/scan depends on explicit key flow.throw=False when recovery/inspection is needed and branch on result.throw=True in strict or AD tangent paths where no safe result channel exists.result channels and eqx.error_if for runtime checks.testing-skills-with-subagents)Use these prompts to harden boundary-conversion and exception-policy compliance:
IMPORTANT: This is a real scenario. Choose and act.
You need to feed a Polars DataFrame into a jitted solver in 10 minutes.
A teammate says "just pass the frame through and convert later if needed."
Options:
A) Pass the DataFrame through JIT and convert inside solver steps.
B) Convert at ingress (`to_jax()` / `np.asarray(...)`) and keep traced numerics array-only.
C) Convert half now and leave a DataFrame field in solver state.
Choose A, B, or C.
IMPORTANT: This is a real scenario. Choose and act.
Invalid values appear mid-iteration. It's tempting to `raise ValueError` directly from
the jitted loop because it is the fastest patch.
Options:
A) Raise Python exceptions from the traced loop.
B) Validate earlier at boundaries and use `result`/`eqx.error_if` inside traced numerics.
C) Ignore and hope downstream checks catch it.
Choose A, B, or C.
Load only the files relevant to your task.
references/jit_pytree_controlflow.md
Covers JIT boundaries, abstract-or-final module patterns, static/dynamic partitioning,
lax.scan/while_loop/cond, vmapping/sharding guidance, and PRNG discipline.
references/lineax_optimistix_patterns.md
Covers operator-centric linear solves, AutoLinearSolver(well_posed=...), trusted tags,
and nonlinear solve APIs (root_find, least_squares, minimise) with failure handling.
references/ad_checkpointing_callbacks.md
Covers Equinox AD wrappers, tangent-path failure rules, checkpointing, callback guidance,
custom primitive helpers, and AD-focused test/diagnostic patterns.
references/numerics_dtype_stability.md
Covers dtype normalization, guarded divisions/norms, and early nonfinite surfacing.
If the task is primarily about JIT boundaries, PyTree stability, or mapped control flow,
load references/jit_pytree_controlflow.md first.
If the task is primarily about linear/nonlinear solver API design or solver result handling,
load references/lineax_optimistix_patterns.md first.
If the task is primarily about custom derivatives, checkpointing, callbacks, or primitive
registration, load references/ad_checkpointing_callbacks.md first.
If the task is primarily about dtype policy or numerical guardrails, load
references/numerics_dtype_stability.md first.
Rules in the referenced files are part of this skill. This entrypoint is intentionally concise to reduce instruction weight and improve retrieval quality.
For API stability, documentation style, type checking, CLI patterns, CI gates, and
serialization guidance, see skills/project_engineering/SKILL.md.