Skip to content

Add AGENTS.md and GitHub Copilot instructions#91

Open
napetrov wants to merge 2 commits intomasterfrom
add-agents-instructions
Open

Add AGENTS.md and GitHub Copilot instructions#91
napetrov wants to merge 2 commits intomasterfrom
add-agents-instructions

Conversation

@napetrov
Copy link

What

Add structured AI agent instructions following Intel's AGENTS spec v4:

  • AGENTS.md — project context for agents (RNG interface, archetype, structure, source-of-truth mapping)
  • .github/copilot-instructions.md — agent behavior policy (precedence, contribution expectations, Intel-specific constraints)

Why

Standardizes how AI coding assistants (GitHub Copilot, Claude, etc.) understand and work with this repo, reducing hallucinations and enforcing Intel engineering standards automatically.

Key guidance added

  • Preserve numpy.random API compatibility by default
  • RNG specifics: BRNG selection and distribution methods must preserve statistical properties
  • Release GIL (with nogil:) for MKL RNG calls (thread-safe in MKL)
  • No hardcoded versions, flags, or BRNG names outside __init__.py
  • Statistical validation required for RNG changes
  • Local dev: conda create -n dev python numpy cython mkl-devel pytest && pip install -e .

Token budget

  • AGENTS.md: 217 words (limit 220)
  • Based on mkl_fft pattern

Checklist

  • AGENTS.md exists at repo root
  • .github/copilot-instructions.md exists
  • Required headings present
  • No placeholder text
  • No mutable details hardcoded
  • Precedence hierarchy documented
  • Word count within limits

Introduce structured AI agent instructions following Intel's AGENTS spec v4:

- AGENTS.md: project context (RNG interface, archetype, structure, source-of-truth)
- .github/copilot-instructions.md: agent behavior policy

Key guidance:
- Preserve numpy.random API compatibility
- RNG specifics: BRNG selection, statistical properties
- Cython: release GIL for MKL RNG calls (thread-safe)
- Local dev: conda env + pip install -e .
- Statistical validation required for RNG changes

Token budget: 217 words (AGENTS.md) + copilot-instructions
Based on mkl_fft pattern
@napetrov
Copy link
Author

napetrov commented Mar 3, 2026

Updated PR with a more useful multi-level AGENTS hierarchy (commit b0e4a38):

  • expanded root AGENTS into entry-point + directory map
  • added local AGENTS in .github, mkl_random/, mkl_random/tests/, conda-recipe/, conda-recipe-cf/, examples/
  • updated copilot-instructions mandatory flow to use nearest AGENTS per edited file

This keeps instructions concise at root and more actionable in each working directory.

@antonwolfy antonwolfy added this to the 1.4.0 release milestone Mar 5, 2026
## Key components
- **Python package:** `mkl_random/`
- **Cython layer:** `mkl_random/mklrand.pyx`
- **C backend/templates:** `mkl_random/src/`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is no templates in mkl_random, but .cpp and .h files only in src folder

@ndgrigorian
Copy link
Collaborator

ndgrigorian commented Mar 6, 2026

@napetrov
interfaces has been added, and main namespace updated, shifting to mkl_random.MKLRandomState + (deprecated) mkl_random.RandomState.

RandomState in numpy_random interface aligned to numpy's numpy.random.RandomState, and mkl_random.interfaces.numpy_random is fully aligned to numpy.random namespace (aside from get_state and set_state, which cannot be)

patch will also be coming soon

otherwise if above comment fixed, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants