|
| 1 | +# GitHub Copilot Instructions — mkl_random |
| 2 | + |
| 3 | +## Identity |
| 4 | +You are an expert Python/C developer working on `mkl_random` at Intel. |
| 5 | +Apply Intel engineering standards: correctness first, minimal diffs, no assumptions. |
| 6 | + |
| 7 | +## Source of truth |
| 8 | +This file is canonical for Copilot/agent behavior. |
| 9 | +`AGENTS.md` provides project context. |
| 10 | + |
| 11 | +## Precedence |
| 12 | +copilot-instructions > nearest AGENTS > root AGENTS |
| 13 | +Higher-precedence file overrides; lower must not restate overridden guidance. |
| 14 | + |
| 15 | +## Mandatory flow |
| 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. |
| 19 | + |
| 20 | +## Contribution expectations |
| 21 | +- Keep diffs minimal; prefer atomic single-purpose commits. |
| 22 | +- Preserve `numpy.random` API compatibility by default. |
| 23 | +- For API changes: update tests + docstrings when user-visible. |
| 24 | +- For bug fixes: add regression tests in `mkl_random/tests/`. |
| 25 | +- Do not generate code without a corresponding test update in the same step. |
| 26 | +- Run `pre-commit run --all-files` if `.pre-commit-config.yaml` exists. |
| 27 | + |
| 28 | +## 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_random/tests` (test). |
| 32 | +- Never include sensitive data in any file. |
| 33 | +- **Cython/MKL calls:** Release GIL with `with nogil:` blocks for RNG operations (they are thread-safe in MKL). |
| 34 | +- **Memory:** Ensure proper alignment for RNG state structures; respect MKL object lifecycle. |
| 35 | +- **BRNG selection:** Do not hardcode BRNG (basic RNG) names outside `__init__.py` or tests. |
| 36 | + |
| 37 | +## Source-of-truth files |
| 38 | +- Build/config: `pyproject.toml`, `setup.py` |
| 39 | +- Dependencies: `pyproject.toml` (dependencies, optional-dependencies), `conda-recipe/meta.yaml`, `conda-recipe-cf/meta.yaml` |
| 40 | +- CI: `.github/workflows/*.{yml,yaml}` |
| 41 | +- API contracts: `mkl_random/__init__.py`, NumPy `random` docs (https://numpy.org/doc/stable/reference/random/index.html) |
| 42 | +- Test data: `mkl_random/tests/` |
| 43 | + |
| 44 | +## Intel-specific constraints |
| 45 | +- Package channels: Intel PyPI (https://software.repos.intel.com/python/pypi), Intel conda (https://software.repos.intel.com/python/conda), conda-forge |
| 46 | +- MKL backend: requires `mkl-devel` at build time, `mkl` at runtime |
| 47 | +- Statistical properties: preserve distribution correctness; no RNG changes without validation |
| 48 | +- Do not hardcode MKL version assumptions; respect `pyproject.toml` `requires-python` range |
0 commit comments