Skip to content

task: agent ready prep - #280

Open
jharlow-intel wants to merge 3 commits into
mainfrom
task/agent-ready
Open

jharlow-intel wants to merge 3 commits into
mainfrom
task/agent-ready

Conversation

@jharlow-intel

@jharlow-intel jharlow-intel commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Very similar to IntelPython/mkl_fft#379: adds contributor and coding-agent guidance (CONTRIBUTING.md, AGENTS.md), PR and issue templates, and a README pointer, checked against this repo's build and CI. It also corrects the existing AGENTS.md files.

Comment thread CONTRIBUTING.md
Comment thread CONTRIBUTING.md Outdated
Comment thread conda-recipe-cf/AGENTS.md Outdated
Comment thread conda-recipe-cf/AGENTS.md Outdated
Comment thread AGENTS.md
Comment thread mkl_umath/src/AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread .github/AGENTS.md
- CONTRIBUTING.md: use --override-channels, install pre-commit with the
  pylint and shellcheck its system hooks need, note Windows support and
  the meson.build GCC/MSVC branches, and match the CHANGELOG link format
- AGENTS.md: restore supported platforms, add the meson.build guardrail,
  and note that checkout tests need the editable install
- conda-recipe-cf/AGENTS.md: gnu_thread is Linux-only, llvm-openmp has no
  run pin, and each recipe has its own conda_build_config.yaml
- mkl_umath/src/AGENTS.md: scope the patch lock claim and note per-thread
  patch/restore balance
- .github/AGENTS.md: list the templates and repo config files

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I checked the docs at 3f8573f against the tree and by running them.

  • I ran the CONTRIBUTING.md setup verbatim in a clean condaforge/miniforge3 container. Creating the env, the editable install, pytest mkl_umath/tests (392 passed, 1 skipped) and pre-commit run --all-files all pass. A control build without -Dmkl_threading=gnu_thread fails at import with libmkl_intel_thread.so.3: undefined symbol: __atomic_compare_exchange, so the gnu_thread note is right.
  • I also ran a static check of the paths, commands and identifiers the guidance names. At head it finds no broken references. At base it found the stale mkl_random mentions and the src/__umath_generated.c path, which this PR fixes.
  • I checked loading with Claude Code 2.1.296. The root AGENTS.md loads from every directory, and each nested one loads once the agent works in its subtree. .github/copilot-instructions.md is never loaded; more on that inline.

A few remaining points are inline. None of them block the PR.

Comment thread CONTRIBUTING.md
On Linux:

```sh
conda create -n mkl_umath-dev --override-channels -c conda-forge python pip \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

python is unpinned here. conda-forge already has Python 3.15.0, while pyproject.toml has requires-python = ">=3.10,<3.15". Today the solve picks 3.14.8 (checked), likely because not every dependency has a 3.15 build yet. Once they all do, this line creates a 3.15 env and the editable install fails on requires-python. I suggest "python<3.15", or a specific python=3.14.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Python 3.15 is going to be enabled in #279

Comment thread conda-recipe/AGENTS.md
- Treat recipe files as canonical for packaging intent and dependency pins.
- Keep recipe changes in step with `.github/workflows/conda-package.yml`, which
builds this recipe and runs the full test suite against the result.
- The package test in `meta.yaml` runs only `test_basic.py`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's worth saying that CI never runs this package test. Both conda workflows call conda build --no-test (conda-package.yml:286, conda-package-cf.yml:275) and run pytest --pyargs mkl_umath in a separate job. Without that note, an agent can assume CI covers a change to the meta.yaml test.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just to note, we run that through the Jenkins currently

Comment thread AGENTS.md
## Development guardrails
- Preserve NumPy ufunc behavior; patched loops stand in for NumPy's own.
- Edit the `*.src` templates and `generate_umath.py`, not generated C.
- Keep the floating-point precision flags in `meson.build`; Intel-only flags stay

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/fp:precise is also set for Windows in both recipes' conda_build_config.yaml (line 20, # [win]), not only in meson.build. Could this line, and CONTRIBUTING.md:47, say "in meson.build and the recipes' conda_build_config.yaml"? That way an agent editing one place knows there is a second.

## Contribution expectations
- Keep changes atomic and single-purpose.
- Preserve runtime patching API (`use_in_numpy()`, `restore()`, `is_patched()`) unless explicitly requested.
- Preserve the runtime patching API (`patch_numpy_umath()`, `restore_numpy_umath()`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This rule exists only in copilot-instructions.md. Claude Code never loads that file (checked with 2.1.296 from every subdirectory), and agents other than Copilot see it only if they follow the pointer at AGENTS.md:53. If the rule should apply to all agents, copying this line into the root AGENTS.md guardrails would cover them.

Also, use_in_numpy() and restore() are still exported in __all__ and exercised in test_patching.py. If they should stay until the deprecation removal, list them here too, or say that they may be removed.

Comment thread .github/AGENTS.md
Comment on lines +8 to +10
- `build_pip.yml` — editable pip build with `icx`, including pre-release NumPy
- `build-with-clang.yml` — build with `icx` from the oneAPI apt repository
- `build-with-standard-clang.yml` — build with upstream clang

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The three pip/clang workflows also run pytest --pyargs, but the doc says "build" only.

description: |
Output of:
```
python -c "import mkl_umath, numpy; print(mkl_umath.__version__); print(numpy.__version__)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It never asks for the MKL version. Suggest conda list mkl / pip list | grep -i mkl; mkl-service isn't a dependency here.

body:
- type: markdown
attributes:
value: |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

With |, GitHub keeps each newline as a hard line break when rendering the form, so these wrapped lines break mid-sentence. The rendered form at this commit has follow<br>SECURITY.md. Same at lines 59-62 and in feature_request.yml:17-19.

Putting each paragraph on one line fixes it. Keep | for the Versions description, which needs it for the code fence.

Comment thread CONTRIBUTING.md
```

`--override-channels` keeps MKL and its OpenMP runtime from mixing with your
configured channels. `gnu_thread` is required with conda-forge's MKL; the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Say "On Linux, gnu_thread is required…", and add that Windows keeps the intel_thread default.

Comment thread CONTRIBUTING.md

## Pull requests

Work on a branch and fill in the PR template. For user-visible changes, add a

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Put "Work on a branch" before the Checks section.
On a branch main, the no-commit-to-branch hook makes pre-commit run --all-files exit 1; on any other branch it passes.

Comment thread conda-recipe-cf/AGENTS.md
- No `conda_build_config.yaml` (uses conda-forge defaults)
- May use different compiler toolchain
- For conda-forge feedstock integration (if upstreamed)
## Differences from `conda-recipe/`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add the NumPy run pin, since cf uses pin_compatible('numpy')

Comment thread benchmarks/AGENTS.md
- Keep inputs deterministic; benchmarks seed their own RNG.
- Report performance numbers with reproducible context: hardware, thread count,
versions, and the command used.
- Results under `benchmarks/.asv/` are local artifacts.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Write .asv/, not benchmarks/.asv/. That matches the file's own dir-relative paths.

Comment thread .gitignore
pip-log.txt
pip-delete-this-directory.txt

# Virtual environments, test caches, local env files

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need to .gitattributes with *.sh eol=lf, matching mkl_fft?

Comment thread _vendored/AGENTS.md
- Prefer updating upstream source when feasible; keep local vendored diffs
minimal.
- Do not refactor vendored code opportunistically in unrelated PRs.
- `black` and `isort` are configured to skip the vendored files

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

flake8 also skips these files (exclude in .flake8). codespell, pylint and the whitespace/EOF hooks still run on them.

Comment thread mkl_umath/tests/AGENTS.md
- Patching: `patch_numpy_umath()`, `restore_numpy_umath()`, `is_patched()` state transitions
- Edge cases: NaN, Inf, empty arrays, large arrays
- Dtype coverage: float32, float64, complex64, complex128
## Expectations

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Worth adding to Expectations, that the tests that patch must restore before returning, in the same thread (try/finally or with mkl_umath.mkl_umath():).

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