|
1 | 1 | # GitHub Copilot Instructions — mkl_fft |
2 | 2 |
|
3 | 3 | ## 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. |
6 | 6 |
|
7 | 7 | ## Source of truth |
8 | 8 | This file is canonical for Copilot/agent behavior. |
9 | | -`AGENTS.md` provides project context. |
| 9 | +`AGENTS.md` files provide project context. |
10 | 10 |
|
11 | 11 | ## Precedence |
12 | 12 | 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. |
14 | 14 |
|
15 | 15 | ## Mandatory flow |
16 | 16 | 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`. |
19 | 19 |
|
20 | 20 | ## 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. |
27 | 26 |
|
28 | 27 | ## 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` |
37 | 34 |
|
38 | 35 | ## Source-of-truth files |
39 | 36 | - 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` |
41 | 38 | - 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/` |
45 | 41 |
|
46 | 42 | ## 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 |
0 commit comments