feat(pipekit): Fourier derivative operators on the spectral carrier
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- backend, performance, testing
Research direction
Start by reading the referenced Tier-A work in #151, #149, and #150, then locate the Tier-B operator definitions and check_operator tests; the payload does not name file paths. Implement each listed operator as a wrapper around its Tier-A method and check allclose results and compiled HLO transform budgets on both carriers and output modes. Verify the barotropic vorticity RHS totals 5 transforms per evaluation and that the Hyperviscosity gradient matches finite differences; the issue notes the latter depends on #103.
Written by the indexing model from the issue text.
Description
Part of epic #148. Depends on: #151 (E4.1), #149 (E4.0a) (traced coefficients), #150 (E4.0b) (spectral_out)
Proposal
One Tier-B op per Tier-A method, each Array | Spectral → Array | Spectral per out. Bodies call Tier A with spectral=isinstance(x, Spectral) and spectral_out=(out == "spectral"). No multipliers are re-implemented.
| op | math (Fourier) | transforms, spectral → spectral | transforms, physical → physical |
|---|---|---|---|
Gradient |
(ikₓ û, ik_y û) | 0 | 1 + 2 |
Divergence |
ikₓ v̂ₓ + ik_y v̂_y | 0 | 2 + 1 |
Curl |
ikₓ v̂_y − ik_y v̂ₓ | 0 | 2 + 1 |
Laplacian |
−|k|² û | 0 | 1 + 1 |
InverseLaplacian |
−û/|k|², mean → 0 | 0 | 1 + 1 |
Biharmonic |
|k|⁴ û | 0 | 1 + 1 |
Hyperviscosity |
−ν |k|²ⁿ û (ν a leaf) | 0 | 1 + 1 |
VelocityFromStreamfunction |
(−ik_y ψ̂, ikₓ ψ̂) | 0 | 1 + 2 |
ProjectVector |
Leray: v̂ − k(k·v̂)/|k|² | 0 | 2 + 2 |
Jacobian |
ℱ[fₓg_y − f_yg_x], 2/3-truncated | 4 inv + 1 fwd | 2 fwd + 4 inv + dealias round trip (1 + 1), today |
AdvectionScalar |
ℱ[u·∇q], 2/3-truncated | 2 inv + 1 fwd if u, v arrive physical; 4 inv + 1 fwd if all three are Spectral |
per #108 |
Dealias |
m ⊙ û | 0 | 1 + 1 |
Each row's spectral → spectral budget is asserted with check_operator(..., budget=...). The physical → physical column documents today's cost and explains why the carrier exists.
Acceptance criteria
- Every op equals its Tier-A method (allclose, x64) on both carriers and both
outmodes. - The budgets in the table hold in compiled HLO.
- Barotropic vorticity RHS
−Jacobian(InverseLaplacian(q), q) + Hyperviscosity(q)on aSpectralinput without="spectral": 5 transforms per evaluation, 20 per RK4 step (prototype: 20, vs 40 on the physical carrier). -
jax.gradw.r.t.Hyperviscosity.numatches finite differences (prototype: −1.0073e8 vs −1.0063e8). This fails today withTracerBoolConversionErroruntil #103 lands.
Generated by Claude Code
- Dominant language
- Python
- Stars
- 2
- Forks
- 0
- Avg merge
- 8h 13m
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jejjohnson/spectraldiffx
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jejjohnson/spectraldiffx#172 ·
-
epic
Difficulty 1/5 Under an hour Newbie friendliness 62/100
jejjohnson/spectraldiffx#167 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
jejjohnson/spectraldiffx#113 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jejjohnson/spectraldiffx#105 ·
-
dependencies
Difficulty 4/5 3-5 days Newbie friendliness 45/100
jejjohnson/spectraldiffx#181 ·
All issues in jejjohnson/spectraldiffx
Similar issues
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorPossibly taken @jejjohnson claimed this today. Opentype:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jejjohnson/integrix#144 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
finos/ai-governance-framework#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days
-
type/bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
h2oai/h2o-llmstudio#1163 ·
Maintainers usually reply within 1 day