-
Notifications
You must be signed in to change notification settings - Fork 22
Add AGENTS.md and GitHub Copilot instructions #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
napetrov
wants to merge
1
commit into
master
Choose a base branch
from
add-agents-instructions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # GitHub Copilot Instructions — mkl_fft | ||
|
|
||
| ## Identity | ||
| You are an expert Python/C developer working on `mkl_fft` at Intel. | ||
| Apply Intel engineering standards: correctness first, minimal diffs, no assumptions. | ||
|
|
||
| ## Source of truth | ||
| This file is canonical for Copilot/agent behavior. | ||
| `AGENTS.md` provides project context. | ||
|
|
||
| ## Precedence | ||
| copilot-instructions > nearest AGENTS > root AGENTS | ||
| Higher-precedence file overrides; lower must not restate overridden guidance. | ||
|
|
||
| ## Mandatory flow | ||
| 1. Read root `AGENTS.md`. If absent, stop and report. | ||
| 2. For edited files, use root AGENTS (no local AGENTS files exist here). | ||
| 3. If future local `AGENTS.md` files appear, find nearest per file. | ||
|
|
||
| ## Contribution expectations | ||
| - Keep diffs minimal; prefer atomic single-purpose commits. | ||
| - Preserve NumPy/SciPy FFT API compatibility by default. | ||
| - For API changes: update tests + docstrings when user-visible. | ||
| - For bug fixes: add regression tests in `mkl_fft/tests/`. | ||
| - Do not generate code without a corresponding test update in the same step. | ||
| - Run `pre-commit run --all-files` before proposing code changes. | ||
|
|
||
| ## Authoring rules | ||
| - Use source-of-truth files for all mutable details. | ||
| - Never invent/hardcode versions, flags, or matrix values. | ||
| - Use stable entry points: `pip install -e .` (dev), `pytest mkl_fft/tests` (test). | ||
| - Never include sensitive data in any file. | ||
| - **C templates:** Edit only `src/*.c.src`; do not manually edit generated `.c` files. | ||
| - **Cython/MKL calls:** Release GIL with `with nogil:` blocks for performance-critical MKL functions. | ||
| - **Memory:** Ensure proper alignment for FFT buffers; respect MKL object lifecycle. | ||
| - **Compiler flags:** Do not hardcode ISA flags (AVX-512, etc.) outside `setup.py`. | ||
|
|
||
| ## Source-of-truth files | ||
| - Build/config: `pyproject.toml`, `setup.py` | ||
| - Dependencies: `pyproject.toml` (dependencies, optional-dependencies), `conda-recipe/meta.yaml`, `conda-recipe-cf/meta.yaml` | ||
| - CI: `.github/workflows/*.{yml,yaml}` | ||
| - Style/lint: `.pre-commit-config.yaml`, `.flake8`, `pyproject.toml` (tool.black, tool.isort, tool.cython-lint) | ||
| - 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) | ||
| - Test data: `mkl_fft/tests/` | ||
|
|
||
| ## Intel-specific constraints | ||
| - Package channels: Intel PyPI (https://software.repos.intel.com/python/pypi), Intel conda (https://software.repos.intel.com/python/conda), conda-forge | ||
| - MKL backend: requires `mkl-devel` at build time, `mkl-service` at runtime | ||
| - Performance: for claims, reference https://github.com/intelpython/fft_benchmark | ||
| - Do not hardcode MKL version assumptions; respect `pyproject.toml` `requires-python` range | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # AGENTS.md — mkl_fft | ||
|
|
||
| ## What this project is | ||
| 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). | ||
|
|
||
| Layers: Python interfaces, Cython bindings (`_pydfti.pyx`), C backend (`src/*.c.src`). | ||
|
|
||
| ## How it's structured | ||
| - `mkl_fft/interfaces/` — drop-in replacements for `numpy.fft`, `scipy.fft` | ||
| - `mkl_fft/src/` — C templates (`.c.src`) | ||
| - `mkl_fft/tests/` — pytest suite | ||
| - `conda-recipe/`, `conda-recipe-cf/` — Intel/conda-forge builds | ||
|
|
||
| Build: `pyproject.toml` + `setup.py`. Runtime: `mkl-service`, `numpy>=1.26.4`. | ||
|
|
||
| ## How to work in it | ||
| - Keep changes atomic and single-purpose. | ||
| - Preserve NumPy/SciPy FFT API; document divergence in commit message. | ||
| - Pair changes with tests and docstrings. | ||
| - Never assume MKL or NumPy versions; use source-of-truth files. | ||
| - **C templates:** Edit only `*.c.src` files; generated `.c` is ephemeral (via `_vendored/conv_template.py`). | ||
| - **Local dev:** `conda create -n dev python numpy cython mkl-devel pytest && pip install -e .` | ||
|
|
||
| For agent policy: `.github/copilot-instructions.md` | ||
|
|
||
| ## Where truth lives | ||
| - Build/config: `pyproject.toml`, `setup.py` | ||
| - Dependencies: `pyproject.toml` (`dependencies`, `optional-dependencies`), `conda-recipe/meta.yaml`, `conda-recipe-cf/meta.yaml` | ||
| - CI: `.github/workflows/` | ||
| - Style/lint: `.pre-commit-config.yaml`, `.flake8`, `pyproject.toml` (black/isort/cython-lint) | ||
| - API/contracts: `mkl_fft/__init__.py`, `mkl_fft/interfaces/`, NumPy/SciPy FFT docs | ||
| - Stable entry points: `python -m pip install .`, `pytest mkl_fft/tests` | ||
|
|
||
| ## Directory map | ||
| No local AGENTS files — project is small enough for root-level guidance only. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instruction to release GIL with
with nogil:blocks is not reflected in the current codebase, which does not usenogilblocks. Since MKL internally manages threading, verify whether this guidance is appropriate. If this is intended as prescriptive guidance for future contributions, consider clarifying that context or verifying with domain experts that GIL release is beneficial for MKL FFT operations.