Skip to content

Commit d9a817a

Browse files
committed
Expand AGENTS docs to multi-level structure
1 parent fd88e5f commit d9a817a

10 files changed

Lines changed: 155 additions & 55 deletions

File tree

.github/AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# AGENTS.md — .github/
2+
3+
CI/CD workflows and repo automation.
4+
5+
## Workflows (source of truth)
6+
- `conda-package.yml` — Intel channel conda build/test pipeline
7+
- `conda-package-cf.yml` — conda-forge-oriented build/test pipeline
8+
- `build-with-clang.yml` — clang compatibility checks
9+
- `build_pip.yaml` — wheel build pipeline
10+
- `pre-commit.yml` — lint/format checks
11+
- `openssf-scorecard.yml` — security scanning
12+
13+
## Policy
14+
- Treat workflow YAML as canonical for platform/Python matrices.
15+
- Avoid doc claims about CI coverage unless present in workflow config.

.github/copilot-instructions.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
11
# GitHub Copilot Instructions — mkl_fft
22

33
## Identity
4-
You are an expert Python/C developer working on `mkl_fft` at Intel.
5-
Apply Intel engineering standards: correctness first, minimal diffs, no assumptions.
4+
You are an expert Python/C/Cython developer working on `mkl_fft` at Intel.
5+
Prioritize correctness, API compatibility, and minimal diffs.
66

77
## Source of truth
88
This file is canonical for Copilot/agent behavior.
9-
`AGENTS.md` provides project context.
9+
`AGENTS.md` files provide project context.
1010

1111
## Precedence
1212
copilot-instructions > nearest AGENTS > root AGENTS
13-
Higher-precedence file overrides; lower must not restate overridden guidance.
13+
Higher-precedence file overrides lower-precedence context.
1414

1515
## Mandatory flow
1616
1. Read root `AGENTS.md`. If absent, stop and report.
17-
2. For edited files, use root AGENTS (no local AGENTS files exist here).
18-
3. If future local `AGENTS.md` files appear, find nearest per file.
17+
2. For each edited file, locate and follow the nearest `AGENTS.md`.
18+
3. If no local file exists, inherit from root `AGENTS.md`.
1919

2020
## Contribution expectations
21-
- Keep diffs minimal; prefer atomic single-purpose commits.
22-
- Preserve NumPy/SciPy FFT API compatibility by default.
23-
- For API changes: update tests + docstrings when user-visible.
24-
- For bug fixes: add regression tests in `mkl_fft/tests/`.
25-
- Do not generate code without a corresponding test update in the same step.
26-
- Run `pre-commit run --all-files` before proposing code changes.
21+
- Keep changes atomic and single-purpose.
22+
- Preserve NumPy/SciPy FFT compatibility by default.
23+
- For behavior changes: update/add tests in `mkl_fft/tests/` in the same change.
24+
- For bug fixes: include a regression test.
25+
- Run `pre-commit run --all-files` when `.pre-commit-config.yaml` is present.
2726

2827
## Authoring rules
29-
- Use source-of-truth files for all mutable details.
30-
- Never invent/hardcode versions, flags, or matrix values.
31-
- Use stable entry points: `pip install -e .` (dev), `pytest mkl_fft/tests` (test).
32-
- Never include sensitive data in any file.
33-
- **C templates:** Edit only `src/*.c.src`; do not manually edit generated `.c` files.
34-
- **Cython/MKL calls:** Release GIL with `with nogil:` blocks for performance-critical MKL functions.
35-
- **Memory:** Ensure proper alignment for FFT buffers; respect MKL object lifecycle.
36-
- **Compiler flags:** Do not hardcode ISA flags (AVX-512, etc.) outside `setup.py`.
28+
- Never invent versions, build flags, CI matrices, or channel policies.
29+
- Use source-of-truth files for mutable details.
30+
- **C templates:** edit only `mkl_fft/src/*.c.src`; do not manually edit generated `.c` files.
31+
- Prefer stable local entry points:
32+
- `python -m pip install -e .`
33+
- `pytest mkl_fft/tests`
3734

3835
## Source-of-truth files
3936
- Build/config: `pyproject.toml`, `setup.py`
40-
- Dependencies: `pyproject.toml` (dependencies, optional-dependencies), `conda-recipe/meta.yaml`, `conda-recipe-cf/meta.yaml`
37+
- Dependencies: `pyproject.toml`, `conda-recipe/meta.yaml`, `conda-recipe-cf/meta.yaml`
4138
- CI: `.github/workflows/*.{yml,yaml}`
42-
- Style/lint: `.pre-commit-config.yaml`, `.flake8`, `pyproject.toml` (tool.black, tool.isort, tool.cython-lint)
43-
- API contracts: `mkl_fft/__init__.py`, `mkl_fft/interfaces/*.py`, NumPy FFT docs (https://numpy.org/doc/stable/reference/routines.fft.html), SciPy FFT docs (https://docs.scipy.org/doc/scipy/reference/fft.html)
44-
- Test data: `mkl_fft/tests/`
39+
- API: `mkl_fft/__init__.py`, `mkl_fft/interfaces/*.py`, `mkl_fft/_pydfti.pyx`
40+
- Tests: `mkl_fft/tests/`
4541

4642
## Intel-specific constraints
47-
- Package channels: Intel PyPI (https://software.repos.intel.com/python/pypi), Intel conda (https://software.repos.intel.com/python/conda), conda-forge
48-
- MKL backend: requires `mkl-devel` at build time, `mkl-service` at runtime
49-
- Performance: for claims, reference https://github.com/intelpython/fft_benchmark
50-
- Do not hardcode MKL version assumptions; respect `pyproject.toml` `requires-python` range
43+
- Build-time MKL: `mkl-devel`; runtime MKL integration via `mkl-service`
44+
- Performance claims require reproducible benchmark context
45+
- Do not introduce ISA-specific assumptions outside explicit build configuration

AGENTS.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
11
# AGENTS.md — mkl_fft
22

3-
## What this project is
4-
NumPy-based Python interface to Intel® oneMKL FFT functions. Provides MKL-accelerated FFT for real/complex transforms. Part of Intel® Distribution for Python. Archetype: **python** (Cython + C extensions).
5-
6-
Layers: Python interfaces, Cython bindings (`_pydfti.pyx`), C backend (`src/*.c.src`).
7-
8-
## How it's structured
9-
- `mkl_fft/interfaces/` — drop-in replacements for `numpy.fft`, `scipy.fft`
10-
- `mkl_fft/src/` — C templates (`.c.src`)
11-
- `mkl_fft/tests/` — pytest suite
12-
- `conda-recipe/`, `conda-recipe-cf/` — Intel/conda-forge builds
13-
14-
Build: `pyproject.toml` + `setup.py`. Runtime: `mkl-service`, `numpy>=1.26.4`.
3+
Entry point for agent context in this repo.
154

16-
## How to work in it
17-
- Keep changes atomic and single-purpose.
18-
- Preserve NumPy/SciPy FFT API; document divergence in commit message.
19-
- Pair changes with tests and docstrings.
20-
- Never assume MKL or NumPy versions; use source-of-truth files.
21-
- **C templates:** Edit only `*.c.src` files; generated `.c` is ephemeral (via `_vendored/conv_template.py`).
22-
- **Local dev:** `conda create -n dev python numpy cython mkl-devel pytest && pip install -e .`
23-
24-
For agent policy: `.github/copilot-instructions.md`
5+
## What this project is
6+
`mkl_fft` is a NumPy/SciPy-compatible FFT interface backed by Intel® oneMKL.
7+
It provides accelerated FFT transforms while aiming to preserve upstream API behavior.
8+
9+
## Key components
10+
- **Package:** `mkl_fft/`
11+
- **Cython bindings:** `mkl_fft/_pydfti.pyx`
12+
- **Template-based C backend:** `mkl_fft/src/*.c.src`
13+
- **Interface adapters:** `mkl_fft/interfaces/`
14+
- **Tests:** `mkl_fft/tests/`
15+
- **Vendored helpers:** `_vendored/`
16+
- **Packaging:** `conda-recipe/`, `conda-recipe-cf/`
17+
18+
## Build/runtime basics
19+
- Build system: `pyproject.toml` + `setup.py`
20+
- Build deps: `cython`, `numpy`, `mkl-devel`
21+
- Runtime deps: `numpy`, `mkl-service`
22+
23+
## Development guardrails
24+
- Preserve NumPy/SciPy FFT API compatibility unless change is explicitly requested.
25+
- Edit template sources (`*.c.src`), not generated C artifacts.
26+
- Pair behavior changes with tests and keep diffs minimal.
27+
- Avoid hardcoding mutable versions/matrices/channels in docs.
2528

2629
## Where truth lives
2730
- Build/config: `pyproject.toml`, `setup.py`
28-
- Dependencies: `pyproject.toml` (`dependencies`, `optional-dependencies`), `conda-recipe/meta.yaml`, `conda-recipe-cf/meta.yaml`
29-
- CI: `.github/workflows/`
30-
- Style/lint: `.pre-commit-config.yaml`, `.flake8`, `pyproject.toml` (black/isort/cython-lint)
31-
- API/contracts: `mkl_fft/__init__.py`, `mkl_fft/interfaces/`, NumPy/SciPy FFT docs
32-
- Stable entry points: `python -m pip install .`, `pytest mkl_fft/tests`
31+
- Dependencies: `pyproject.toml`, `conda-recipe*/meta.yaml`
32+
- CI/workflows: `.github/workflows/*.{yml,yaml}`
33+
- Public API: `mkl_fft/__init__.py`, `mkl_fft/interfaces/`
34+
- Tests: `mkl_fft/tests/`
35+
36+
For behavior policy, see `.github/copilot-instructions.md`.
3337

3438
## Directory map
35-
No local AGENTS files — project is small enough for root-level guidance only.
39+
Use nearest local `AGENTS.md` when present:
40+
- `.github/AGENTS.md` — CI workflows and automation policy
41+
- `mkl_fft/AGENTS.md` — package-level implementation context
42+
- `mkl_fft/interfaces/AGENTS.md` — NumPy/SciPy interface adapters
43+
- `mkl_fft/src/AGENTS.md` — C template backend rules
44+
- `mkl_fft/tests/AGENTS.md` — test scope/conventions
45+
- `conda-recipe/AGENTS.md` — Intel-channel conda packaging
46+
- `conda-recipe-cf/AGENTS.md` — conda-forge recipe context
47+
- `_vendored/AGENTS.md` — vendored tooling boundaries

_vendored/AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# AGENTS.md — _vendored/
2+
3+
Vendored utilities used by build/code-generation flows.
4+
5+
## Guardrails
6+
- Prefer updating upstream source when feasible; keep local vendored diffs minimal.
7+
- Do not refactor vendored code opportunistically in unrelated PRs.
8+
- If vendored logic affects generated sources, validate downstream build/test paths.

conda-recipe-cf/AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# AGENTS.md — conda-recipe-cf/
2+
3+
Conda-forge recipe context for `mkl_fft`.
4+
5+
## Scope
6+
- conda-forge specific recipe files under this directory.
7+
8+
## Guardrails
9+
- Keep conda-forge recipe semantics separate from Intel-channel recipe.
10+
- Align changes with `conda-package-cf.yml` workflow behavior.

conda-recipe/AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AGENTS.md — conda-recipe/
2+
3+
Intel-channel conda packaging context.
4+
5+
## Scope
6+
- `meta.yaml` — package metadata and dependency pins
7+
- `build.sh` / `bld.bat` — platform build scripts
8+
9+
## Guardrails
10+
- Treat recipe files as canonical for packaging intent.
11+
- Keep recipe updates synchronized with CI workflow behavior.

mkl_fft/AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AGENTS.md — mkl_fft/
2+
3+
Core package implementation for MKL-backed FFT operations.
4+
5+
## Key files
6+
- `__init__.py` — public package API surface
7+
- `_pydfti.pyx` — Cython bindings for DFTI interactions
8+
- `_mkl_fft.py` / `_fft_utils.py` — runtime FFT helper logic
9+
- `interfaces/` — NumPy/SciPy adapter modules
10+
- `src/` — C template backend (`*.c.src`)
11+
- `tests/` — package tests (see local AGENTS in tests)
12+
13+
## Guardrails
14+
- Preserve NumPy/SciPy-compatible behavior by default.
15+
- Keep adapter, binding, and backend changes coordinated with tests.
16+
- Prefer minimal isolated edits around changed API paths.

mkl_fft/interfaces/AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AGENTS.md — mkl_fft/interfaces/
2+
3+
Adapter layer for `numpy.fft` / `scipy.fft` style interfaces.
4+
5+
## Scope
6+
- Interface modules mapping user-facing calls to MKL-backed implementation.
7+
8+
## Guardrails
9+
- Preserve function signatures and behavioral expectations unless explicitly requested.
10+
- Keep compatibility with upstream NumPy/SciPy semantics in mind.
11+
- Any user-visible behavior change here should include tests in `mkl_fft/tests/`.

mkl_fft/src/AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AGENTS.md — mkl_fft/src/
2+
3+
C template backend for FFT internals.
4+
5+
## Scope
6+
- Template sources (`*.c.src`) used to generate C implementation artifacts.
7+
8+
## Guardrails
9+
- Edit template files (`*.c.src`) rather than generated `.c` files.
10+
- Keep template changes tightly scoped and validated by tests.
11+
- Coordinate with Cython/binding/API layers when changing function behavior.

mkl_fft/tests/AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AGENTS.md — mkl_fft/tests/
2+
3+
Test suite for FFT API compatibility and regressions.
4+
5+
## Expectations
6+
- Behavior changes should include test updates in the same PR.
7+
- Bug fixes require regression tests.
8+
- Keep tests deterministic and avoid brittle performance-dependent assertions.
9+
10+
## Entry point
11+
- `pytest mkl_fft/tests`

0 commit comments

Comments
 (0)