-
Notifications
You must be signed in to change notification settings - Fork 14
Add AGENTS.md and GitHub Copilot instructions #91
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
3
commits 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 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,14 @@ | ||
| # AGENTS.md — .github/ | ||
|
|
||
| CI/CD workflows and repo automation. | ||
|
|
||
| ## Workflows (source of truth) | ||
| - `conda-package.yml` — Intel channel conda build/test pipeline | ||
| - `conda-package-cf.yml` — conda-forge-oriented build/test pipeline | ||
| - `build-with-clang.yml` — clang compatibility checks | ||
| - `build-docs.yml` — docs build pipeline | ||
|
|
||
| ## Policy | ||
| - Treat workflow YAML as canonical for platform/Python matrices. | ||
| - Keep artifact naming and channel usage aligned with workflow files. | ||
| - Avoid doc claims about CI coverage unless present in workflow config. |
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,45 @@ | ||
| # GitHub Copilot Instructions — mkl_random | ||
|
|
||
| ## Identity | ||
| You are an expert Python/C/Cython developer working on `mkl_random` at Intel. | ||
| Prioritize correctness, numerical/statistical integrity, and minimal diffs. | ||
|
|
||
| ## Source of truth | ||
| This file is canonical for Copilot/agent behavior. | ||
| `AGENTS.md` files provide project context. | ||
|
|
||
| ## Precedence | ||
| copilot-instructions > nearest AGENTS > root AGENTS | ||
| Higher-precedence file overrides lower-precedence context. | ||
|
|
||
| ## Mandatory flow | ||
| 1. Read root `AGENTS.md`. If absent, stop and report. | ||
| 2. For each edited file, locate and follow the nearest `AGENTS.md`. | ||
| 3. If no local file exists, inherit from root `AGENTS.md`. | ||
|
|
||
| ## Contribution expectations | ||
| - Keep changes atomic and single-purpose. | ||
| - Preserve `numpy.random` compatibility by default. | ||
| - For behavior changes: update/add tests in `mkl_random/tests/` in the same change. | ||
| - For bug fixes: include a regression test. | ||
| - Run `pre-commit run --all-files` when `.pre-commit-config.yaml` is present. | ||
|
|
||
| ## Authoring rules | ||
| - Never invent versions, build flags, CI matrices, or channel policies. | ||
| - Use source-of-truth files for mutable details. | ||
| - Do not hardcode BRNG behavior outside intended API/configuration points. | ||
| - Prefer stable local entry points: | ||
| - `python -m pip install -e .` | ||
| - `pytest mkl_random/tests` | ||
|
|
||
| ## Source-of-truth files | ||
| - Build/config: `pyproject.toml`, `setup.py` | ||
| - Dependencies: `pyproject.toml`, `conda-recipe/meta.yaml`, `conda-recipe-cf/meta.yaml` | ||
| - CI: `.github/workflows/*.{yml,yaml}` | ||
| - API: `mkl_random/__init__.py`, `mkl_random/mklrand.pyx` | ||
| - Tests: `mkl_random/tests/` | ||
|
|
||
| ## Intel-specific constraints | ||
| - Build-time MKL: `mkl-devel`; runtime MKL: `mkl` | ||
| - Preserve statistical properties for distribution/BRNG-related changes | ||
| - Do not claim performance/statistical improvements without reproducible validation |
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,44 @@ | ||
| # AGENTS.md — mkl_random | ||
|
|
||
| Entry point for agent context in this repo. | ||
|
|
||
| ## What this project is | ||
| `mkl_random` is a NumPy-compatible random module backed by Intel® oneMKL RNG. | ||
| It provides accelerated random sampling with API compatibility goals relative to `numpy.random`. | ||
|
|
||
| ## Key components | ||
| - **Python package:** `mkl_random/` | ||
| - **Cython layer:** `mkl_random/mklrand.pyx` | ||
| - **C backend/templates:** `mkl_random/src/` | ||
| - **Tests:** `mkl_random/tests/` | ||
| - **Packaging:** `conda-recipe/`, `conda-recipe-cf/` | ||
| - **Examples:** `examples/` | ||
|
|
||
| ## Build/runtime basics | ||
| - Build system: `pyproject.toml` + `setup.py` | ||
| - Build deps: `cython`, `numpy`, `mkl-devel` | ||
| - Runtime deps: `numpy`, `mkl` | ||
|
|
||
| ## Development guardrails | ||
| - Preserve `numpy.random` API compatibility unless change is explicitly requested. | ||
| - RNG changes must preserve statistical correctness and reproducibility expectations. | ||
| - Keep diffs minimal and pair behavior changes with tests. | ||
| - Avoid hardcoding mutable versions/matrices/channels in docs. | ||
|
|
||
| ## Where truth lives | ||
| - Build/config: `pyproject.toml`, `setup.py` | ||
| - Dependencies: `pyproject.toml`, `conda-recipe*/meta.yaml` | ||
| - CI matrices/workflows: `.github/workflows/*.{yml,yaml}` | ||
| - Public API: `mkl_random/__init__.py` | ||
| - Tests: `mkl_random/tests/` | ||
|
|
||
| For behavior policy, see `.github/copilot-instructions.md`. | ||
|
|
||
| ## Directory map | ||
| Use nearest local `AGENTS.md` when present: | ||
| - `.github/AGENTS.md` — CI workflows and automation policy | ||
| - `mkl_random/AGENTS.md` — package-level implementation context | ||
| - `mkl_random/tests/AGENTS.md` — testing scope and conventions | ||
| - `conda-recipe/AGENTS.md` — Intel-channel conda packaging | ||
| - `conda-recipe-cf/AGENTS.md` — conda-forge recipe context | ||
| - `examples/AGENTS.md` — runnable examples and expected behavior | ||
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,10 @@ | ||
| # AGENTS.md — conda-recipe-cf/ | ||
|
|
||
| Conda-forge recipe context for `mkl_random`. | ||
|
|
||
| ## Scope | ||
| - conda-forge specific `meta.yaml` and build scripts in this directory. | ||
|
|
||
| ## Guardrails | ||
| - Keep conda-forge recipe semantics separate from Intel-channel recipe. | ||
| - Align recipe changes with `conda-package-cf.yml` workflow behavior. |
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,12 @@ | ||
| # AGENTS.md — conda-recipe/ | ||
|
|
||
| Intel-channel conda packaging context. | ||
|
|
||
| ## Scope | ||
| - `meta.yaml` — package metadata and dependency pins | ||
| - `build.sh` / `bld.bat` — platform build scripts | ||
|
|
||
| ## Guardrails | ||
| - Treat recipe files as canonical for build/runtime dependency intent. | ||
| - Keep recipe updates synchronized with CI workflow expectations. | ||
| - Do not infer platform/Python matrix from docs; read workflow YAML. |
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,11 @@ | ||
| # AGENTS.md — examples/ | ||
|
|
||
| Runnable usage examples for `mkl_random`. | ||
|
|
||
| ## Intent | ||
| - Demonstrate practical usage patterns (parallel MC, random states, etc.). | ||
| - Serve as quick sanity checks, not exhaustive correctness/performance tests. | ||
|
|
||
| ## Guardrails | ||
| - Keep examples concise and runnable. | ||
| - If API behavior in examples changes, keep comments/output expectations consistent. |
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,16 @@ | ||
| # AGENTS.md — mkl_random/ | ||
|
|
||
| Core package implementation for MKL-backed random functionality. | ||
|
|
||
| ## Key files | ||
| - `__init__.py` — public package exports/API wiring | ||
| - `mklrand.pyx` — Cython bindings to MKL RNG support | ||
| - `_init_helper.py` — platform/runtime loading helpers | ||
| - `src/` — C-level support and generation assets | ||
| - `tests/` — package tests (see local AGENTS in tests) | ||
|
|
||
| ## Guardrails | ||
| - Preserve `numpy.random`-compatible behavior by default. | ||
| - RNG algorithm/distribution changes must preserve statistical correctness. | ||
| - Keep BRNG/distribution behavior explicit and test-covered. | ||
| - Prefer minimal, isolated edits around touched API paths. |
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,12 @@ | ||
| # AGENTS.md — mkl_random/tests/ | ||
|
|
||
| Test suite for RNG behavior, API compatibility, and regressions. | ||
|
|
||
| ## Expectations | ||
| - Behavior changes in package code should include test updates in the same PR. | ||
| - Add regression tests for bug fixes. | ||
| - Keep tests deterministic when possible (fixed seeds / stable assertions). | ||
| - For statistical assertions, use robust criteria and document rationale. | ||
|
|
||
| ## Entry point | ||
| - `pytest mkl_random/tests` |
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.
Uh oh!
There was an error while loading. Please reload this page.