|
1 | 1 | # GitHub Copilot Instructions — mkl_random |
2 | 2 |
|
3 | 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. |
| 4 | +You are an expert Python/C/Cython developer working on `mkl_random` at Intel. |
| 5 | +Prioritize correctness, numerical/statistical integrity, 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.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. |
| 21 | +- Keep changes atomic and single-purpose. |
| 22 | +- Preserve `numpy.random` compatibility by default. |
| 23 | +- For behavior changes: update/add tests in `mkl_random/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_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. |
| 28 | +- Never invent versions, build flags, CI matrices, or channel policies. |
| 29 | +- Use source-of-truth files for mutable details. |
| 30 | +- Do not hardcode BRNG behavior outside intended API/configuration points. |
| 31 | +- Prefer stable local entry points: |
| 32 | + - `python -m pip install -e .` |
| 33 | + - `pytest mkl_random/tests` |
36 | 34 |
|
37 | 35 | ## Source-of-truth files |
38 | 36 | - Build/config: `pyproject.toml`, `setup.py` |
39 | | -- 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` |
40 | 38 | - 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/` |
| 39 | +- API: `mkl_random/__init__.py`, `mkl_random/mklrand.pyx` |
| 40 | +- Tests: `mkl_random/tests/` |
43 | 41 |
|
44 | 42 | ## 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 |
| 43 | +- Build-time MKL: `mkl-devel`; runtime MKL: `mkl` |
| 44 | +- Preserve statistical properties for distribution/BRNG-related changes |
| 45 | +- Do not claim performance/statistical improvements without reproducible validation |
0 commit comments