feat(pipekit): `spectraldiffx.pipekit` scaffolding — `Spectral` carrier, transforms, `GridSpec`, contract test
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start by reading the pipekit E1.2 JaxOperator contract and the implementation around Graph.describe() and JSON state round trips. Then implement the proposed spectraldiffx/pipekit/ modules and use testing.py to check transforms, pytree behavior, and operator contracts. The issue is done when the listed acceptance criteria pass, including the optional dependency error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Part of epic #148. Depends on: pipekit E1.2 (pipekit_jax.JaxOperator). Not blocked by #108.
Proposal
spectraldiffx/
pipekit/
__init__.py
_src/
carrier.py # Spectral, as_hat, emit
base.py # SpectralOperator, GridSpec, build_grid
transforms.py # ToSpectral, ToPhysical
derivatives.py # #152 (E4.2)
solvers.py # #153 (E4.3)
diagnostics.py # #154 (E4.4)
testing.py # check_operator, count_transforms
class Spectral(eqx.Module):
"""Fourier coefficients of a real field. hat: complex[..., Ny, Nx(/2+1)]"""
hat: Array
real: bool = eqx.field(static=True, default=False) # True → rfft layout (#108)
# linear algebra on the carrier, so LinComb / RK stages work unchanged
def __add__(self, o): return Spectral(self.hat + o.hat, self.real)
def __sub__(self, o): return Spectral(self.hat - o.hat, self.real)
def __mul__(self, c): return Spectral(c * self.hat, self.real) # scalar only
__rmul__ = __mul__
def __neg__(self): return Spectral(-self.hat, self.real)
GridSpec = tuple # (Nx, Ny, Lx, Ly, dealias) — JSON primitives
class SpectralOperator(JaxOperator):
grid: GridSpec = eqx.field(static=True)
out: Literal["physical", "spectral"] = eqx.field(static=True, default="physical")
Carrier helpers, the single place representation is decided:
def as_hat(x, grid): # Array → transform; Spectral → as is
def emit(hat, grid, out, real): # out="spectral" → Spectral; else inverse (.real)
ToSpectral(grid): real [..., Ny, Nx] → Spectral. ToPhysical(grid): Spectral → real. Both are explicit graph nodes, so where the transforms happen is visible in Graph.describe().
testing.count_transforms(fn, *args) -> dict[str, int] counts fft_type=FFT|IFFT|RFFT|IRFFT in jax.jit(fn).lower(*args).compile().as_text(). check_operator(op, *inputs, budget=None) asserts:
- JSON
stateround-trip; - eager ≡ jit;
- leading-axis broadcast on
[2, …]stacks; - grad finite;
- if
budgetis given,count_transformsequals it.
Acceptance criteria
-
Spectralis a pytree.jax.tree.map,vmapandlax.scancarries all work, andrealsurvives round trips as static metadata. -
ToPhysical(ToSpectral(x)) == x(allclose) for random real fields, for both layouts once #108 adds rfft. - Budgets:
ToSpectral1 forward,ToPhysical1 inverse,ToPhysical ∘ ToSpectralexactly 2 (no silent extra transforms). -
import spectraldiffx.pipekitwithout pipekit raises anImportErrornaming the extra.
Generated by Claude Code
- Ngôn ngữ chính
- Python
- Star
- 2
- Fork
- 0
- Merge trung bình
- 8 giờ 13 phút
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jejjohnson/spectraldiffx
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jejjohnson/spectraldiffx#172 ·
-
[EPIC] spectraldiffx roadmapĐang mởepic
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
jejjohnson/spectraldiffx#167 · 1 bình luận ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
jejjohnson/spectraldiffx#113 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
jejjohnson/spectraldiffx#105 ·
-
dependencies
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
jejjohnson/spectraldiffx#181 ·
Tất cả issue của jejjohnson/spectraldiffx
Issue tương tự
-
A JSON chat answer blocks the backend event loop for the whole RAG runCó thể đã có người làm @NopeCharon đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
The-OpenROAD-Project/ORAssistant#656 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorCó thể đã có người làm @jejjohnson đã nhận hôm nay. Đang mởtype:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
jejjohnson/integrix#144 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
finos/ai-governance-framework#459 ·
-
slurm: a case outcome nested too deep crashes status/collect instead of reading as no outcomeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày