From 25fbff33aa715a4d9a8292010e93525a2a1f1134 Mon Sep 17 00:00:00 2001 From: vchamarthi Date: Thu, 19 Nov 2026 12:38:50 -0600 Subject: [PATCH 1/5] Add REVIEW.md with review guidelines Lists what a pull request must show before merge: NumPy/SciPy parity and layout/dtype edge cases, regression tests against an independent reference, measured performance evidence, C backend and packaging checks, changelog entries, and extra checks for automatically generated pull requests. Signed-off-by: vchamarthi --- REVIEW.md | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 REVIEW.md diff --git a/REVIEW.md b/REVIEW.md new file mode 100644 index 00000000..31bf89b5 --- /dev/null +++ b/REVIEW.md @@ -0,0 +1,116 @@ +# REVIEW.md - mkl_fft + +What a reviewer of an `mkl_fft` pull request checks. Applies to human and automated reviewers alike. +Repository layout and coding rules are in [AGENTS.md](AGENTS.md); this file covers what a change must +prove before it is merged. + +## Correctness + +- NumPy and SciPy FFT behavior is the reference. A change must give the same values, dtype, shape and + errors as `numpy.fft` / `scipy.fft` for the same call, unless the pull request says otherwise and why. +- Any change to the decision whether oneMKL writes straight into the caller's `out=` or into a temporary + must check the array actually handed to the backend (after casting and padding), not the one the + caller passed. Getting this wrong gives wrong values or writes outside `out`. +- Check these cases whenever a transform path, a layout check or a dtype dispatch changes: + - C-ordered, F-ordered, strided and negative-stride inputs and `out=`, rank 1, 2 and 3 or more; + - `s=` shorter and longer than the input, `axes=` with negative and repeated values; + - every `norm` with and without `out=` and `s=`; + - float16, int and bool inputs that must be cast; float32/float64, complex64/complex128; + - zero-length axes, a length-1 axis, NaN, inf and signed zero. +- A pull request that claims "no behavior change" shows it for the cases above, not in prose only. +- Integer counts passed to oneMKL (`MKL_INT`) are checked against the full product of the sizes involved, + not one dimension. + +- `workers` follows SciPy semantics (negative values count back from the maximum, `scipy.fft.set_workers` + is honored) and is capped by oneMKL's own maximum thread count, not `os.cpu_count()`. + +## Patching NumPy and SciPy + +- Patch and unpatch are idempotent, reentrant and thread-safe: saved originals are not shared mutable + class state, nested or repeated patching restores the true originals, and unpatching in one thread + cannot drop another thread's patch. +- Startup patching works for the cases the docs show (for example scripts, not only interactive + sessions), and code that runs at interpreter startup cannot break every Python process on error. +- SciPy and `mkl-service` stay optional: imports that need them are conditional, so installing + `mkl_fft` does not force them on users who only need NumPy. + +## Tests + +- Every behavior change and every fix comes with a test that fails on the base branch and passes on the + pull request. +- Tests compare against an independent reference (`numpy.fft` or a hand-computed result), never against + `mkl_fft` itself or a patched `numpy.fft`. +- When a failure needs more memory or time than CI has, the pull request includes the command and the + output of a manual run instead. +- Check that the CI job meant to cover the change ran its tests (a job can pass with zero tests). + +## Performance claims + +- A claim that a change is faster or uses less memory needs numbers: before and after, on the same + machine, with the hardware, thread count, versions and the command used (see + [benchmarks/AGENTS.md](benchmarks/AGENTS.md)). The ASV suite in `benchmarks/` is the preferred source. +- Results come with a noise estimate (repeat runs or an A/A comparison). Changes inside the noise are not + a speedup. +- Every row of a results table is read, not only the headline: a slowdown in any case is called out and + justified, or fixed. +- When CI publishes benchmark results for the commit, the claim is checked against them. A claim with no + measured number behind it is flagged. +- Benchmark changes keep the DFTI warmup in `setup`, keep imports and setup out of timed code, and use + portable core detection. Changing the thread default or setup invalidates comparison with older results. +- A performance change must not change results. Review it as a behavior change too. + +## C backend and Cython + +- Edit `mkl_fft/src/*.c.src` templates, not generated C. +- Every allocation and DFTI call has its failure path checked, with no leak and a Python exception set. +- The GIL is released only around code that touches no Python objects, consistently across the + contiguous and strided paths. +- Avoid bare `except:`; catch the specific error. +- Reuse existing helpers (for example the argument handling in `_fft_utils.py`) rather than copying logic. + +## Packaging and CI + +- Dependency floors in `conda-recipe*/meta.yaml` agree with `pyproject.toml`; numpy compatibility comes + from its `run_exports`, not from ignoring them. +- On macOS each runtime path is its own `-Wl,-rpath` argument. +- Free-threaded Python builds keep the classifier and build pins that support them. +- Any OpenMP or threading library the build links is one the recipe actually ships at run time. +- Formatters and linters exclude `*.c.src` templates and `_vendored/`; formatting a template breaks its + `@name@` placeholders. +- GitHub Actions are pinned to a full commit SHA with a matching version comment. + +## Automated pull requests + +Pull requests opened by an automated agent (their description starts with "This pull request is entirely +AI-generated") get the full review above, plus these checks. The agent writes code from reading the +source; it does not build, run tests or measure anything, so nothing in such a pull request has run +until its CI has. + +- **One change.** The pull request does exactly one optimization or one bug fix, never both, and touches + only `mkl_fft/` sources and `mkl_fft/tests/`. Changes to build files, recipes, workflows, benchmarks, + `CHANGELOG.md` or generated C are out of scope and are flagged. +- **Fix needs a failing test.** A `fix:` pull request adds a test that fails on the base branch and + passes with the fix. Confirm from CI that it fails without the fix; a test that also passes on the base + branch is not a regression test. +- **Speedup needs a number.** A `perf:` pull request states a mechanism, not a measurement. Accept it + only when the benchmark run attached to the pull request shows the gain beyond noise, with no slowdown + in other cases. Without that run the change is not proven faster. +- **Behavior is unchanged.** A `perf:` change must keep results identical for every dtype, shape, + stride, `out=`, `s=`, `axes=` and `norm`. Check the cases in [Correctness](#correctness) against the code. +- **Tests are not weakened.** No test function removed, no new `skip` or `xfail`, no loosened tolerance + or changed expected value without the upstream NumPy/SciPy behavior that justifies it. Verify that + upstream behavior yourself. +- **Rule files.** An edit to any `AGENTS.md`, `REVIEW.md` or `.github/copilot-instructions.md` changes + the rules future automated runs follow. Review it as a policy change, separately from the code. +- **Known risk spots.** Past automated changes went wrong in the check deciding whether oneMKL writes + into `out=` directly (wrong array checked: wrong values and writes outside `out`), in integer counts + checked on one dimension only, and in benchmark tables hiding a slowdown in one row. +- **Text.** The description lists the changed paths and a short motivation. It contains no claimed + numbers, no commands that were not run, and no agent narration. + +## Pull request text + +- `CHANGELOG.md` has an entry under the `[dev]` section with a working link to the pull request and to + every issue it fixes. +- The description states what changed, why, and the evidence. It contains no tool or agent scaffolding + text (prompts, "mandates", notes about reading instruction files). From 0978603824bc477ba09f83ea583c019ae6191470 Mon Sep 17 00:00:00 2001 From: vchamarthi Date: Thu, 19 Nov 2026 13:13:55 -0600 Subject: [PATCH 2/5] REVIEW.md: automated pull requests run pre-commit and may carry maintainer edits Signed-off-by: vchamarthi --- REVIEW.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/REVIEW.md b/REVIEW.md index 31bf89b5..07e37bc2 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -83,8 +83,9 @@ prove before it is merged. Pull requests opened by an automated agent (their description starts with "This pull request is entirely AI-generated") get the full review above, plus these checks. The agent writes code from reading the -source; it does not build, run tests or measure anything, so nothing in such a pull request has run -until its CI has. +source and runs only the pre-commit hooks; it does not build, run tests or measure anything, so the code +has not run until CI has. Maintainers may later push commits or edit the description of such a pull +request, so check who wrote each commit and each claim. - **One change.** The pull request does exactly one optimization or one bug fix, never both, and touches only `mkl_fft/` sources and `mkl_fft/tests/`. Changes to build files, recipes, workflows, benchmarks, @@ -105,8 +106,9 @@ until its CI has. - **Known risk spots.** Past automated changes went wrong in the check deciding whether oneMKL writes into `out=` directly (wrong array checked: wrong values and writes outside `out`), in integer counts checked on one dimension only, and in benchmark tables hiding a slowdown in one row. -- **Text.** The description lists the changed paths and a short motivation. It contains no claimed - numbers, no commands that were not run, and no agent narration. +- **Text.** The description lists the changed paths and a short motivation, with no agent narration. + The agent itself claims no numbers; any measured numbers added later state who measured them, on + what machine and with which command. ## Pull request text From 10277d70a0ff43beaa0169de3f428d7c16407764 Mon Sep 17 00:00:00 2001 From: vchamarthi Date: Thu, 19 Nov 2026 13:44:24 -0600 Subject: [PATCH 3/5] REVIEW.md: add verification steps, fix CHANGELOG rule for automated pull requests - How to verify: build, test, lint, fail-on-base, A/A then ASV, and an unpatched NumPy reference. - Automated pull requests: detect by author and branch; the agent does not write CHANGELOG.md, a maintainer adds the entry; review the current state. - Correctness and tests: result memory order, input not modified, empty axes, longdouble, no duplicate tests, copyright header, stale asserts. - Pull request text: keep the exemption for changes that are not user-visible, follow the pull request template. - Rewritten as checks, under 100 lines. Signed-off-by: vchamarthi --- REVIEW.md | 175 ++++++++++++++++++++++++------------------------------ 1 file changed, 76 insertions(+), 99 deletions(-) diff --git a/REVIEW.md b/REVIEW.md index 07e37bc2..df24b2c1 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -1,118 +1,95 @@ # REVIEW.md - mkl_fft -What a reviewer of an `mkl_fft` pull request checks. Applies to human and automated reviewers alike. -Repository layout and coding rules are in [AGENTS.md](AGENTS.md); this file covers what a change must -prove before it is merged. +Checks for every `mkl_fft` pull request, by human or automated reviewers. Layout and coding rules are in +AGENTS.md and CONTRIBUTING.md. Apply the sections for the files touched, plus Tests, Pull request text +and Automated pull requests when it applies. Each rule is a check: flag a failure with its section. -## Correctness +## How to verify +Say which of these you ran, and on what platform. -- NumPy and SciPy FFT behavior is the reference. A change must give the same values, dtype, shape and - errors as `numpy.fft` / `scipy.fft` for the same call, unless the pull request says otherwise and why. -- Any change to the decision whether oneMKL writes straight into the caller's `out=` or into a temporary - must check the array actually handed to the backend (after casting and padding), not the one the - caller passed. Getting this wrong gives wrong values or writes outside `out`. -- Check these cases whenever a transform path, a layout check or a dtype dispatch changes: - - C-ordered, F-ordered, strided and negative-stride inputs and `out=`, rank 1, 2 and 3 or more; - - `s=` shorter and longer than the input, `axes=` with negative and repeated values; - - every `norm` with and without `out=` and `s=`; - - float16, int and bool inputs that must be cast; float32/float64, complex64/complex128; - - zero-length axes, a length-1 axis, NaN, inf and signed zero. -- A pull request that claims "no behavior change" shows it for the cases above, not in prose only. -- Integer counts passed to oneMKL (`MKL_INT`) are checked against the full product of the sizes involved, - not one dimension. +1. Build `pip install -e . --no-build-isolation` (CONTRIBUTING.md, Development setup), then run + `pytest mkl_fft/tests` and `pre-commit run --all-files`. A fix's new test must fail on base. +2. For performance, run base against base (A/A) for noise, then base against the pull request, with the + ASV modules in `benchmarks/` that exercise the changed path (see `benchmarks/AGENTS.md`). +3. Reference is NumPy's own FFT. If `numpy.fft.fft.__module__` names `mkl_fft` (Intel-channel NumPy), + use `numpy.fft._pocketfft`. -- `workers` follows SciPy semantics (negative values count back from the maximum, `scipy.fft.set_workers` - is honored) and is capped by oneMKL's own maximum thread count, not `os.cpu_count()`. +## Correctness +- Same values, dtype, shape, result memory order (C/F) and errors as `numpy.fft`/`scipy.fft` for the + same call; any difference is stated and justified in the pull request. +- The caller's input is never modified; nothing outside `out` is written. Whether oneMKL writes + straight into `out=` is decided on the array handed to the backend (after casting and padding), not + the caller's; getting it wrong gives wrong values and writes outside `out`. +- When a transform path, layout check or dtype dispatch changes, cover: + - input and `out=` C-, F- or both-contiguous (`(m, 1)`), strided, negative-stride; rank 1, 2, 3+; + - `s=`/`n=` shorter and longer than the input; `axes=` negative, repeated, empty; + - every `norm`, with and without `out=` and `s=`; + - float16, int, bool (cast); float32/64, complex64/128; longdouble if present; + - zero-length and length-1 axes; NaN, inf, signed zero. +- "No behavior change" is proven for those cases by a test or recorded comparison, not prose. +- `MKL_INT` counts are checked on the full product of sizes, not one dimension. +- `workers` follows SciPy (negative counts back from the max, `scipy.fft.set_workers` honored), + capped by oneMKL's maximum thread count, not `os.cpu_count()`. ## Patching NumPy and SciPy - -- Patch and unpatch are idempotent, reentrant and thread-safe: saved originals are not shared mutable - class state, nested or repeated patching restores the true originals, and unpatching in one thread - cannot drop another thread's patch. -- Startup patching works for the cases the docs show (for example scripts, not only interactive - sessions), and code that runs at interpreter startup cannot break every Python process on error. -- SciPy and `mkl-service` stay optional: imports that need them are conditional, so installing - `mkl_fft` does not force them on users who only need NumPy. +- Patch/unpatch are idempotent, reentrant, thread-safe: no shared mutable originals, repeated patching + restores the true originals, one thread's unpatch keeps another's patch, `is_patched()` is truthful. +- Startup patching works in the documented cases (scripts too); a startup error cannot break Python. +- SciPy and `mkl-service` stay optional: imports that need them are conditional. ## Tests - -- Every behavior change and every fix comes with a test that fails on the base branch and passes on the - pull request. -- Tests compare against an independent reference (`numpy.fft` or a hand-computed result), never against - `mkl_fft` itself or a patched `numpy.fft`. -- When a failure needs more memory or time than CI has, the pull request includes the command and the - output of a manual run instead. -- Check that the CI job meant to cover the change ran its tests (a job can pass with zero tests). +- Every behavior change and fix has a test that fails on base and passes on the pull request. +- Expected values come from an independent reference (step 3) or by hand, never `mkl_fft` itself. +- Extend or parametrize existing tests rather than duplicate them; parametrize rather than skip inside. +- Deterministic, no timing asserts, copyright header on new files. A failure too large for CI comes + with a manual run's command and output. +- The CI job meant to cover the change ran its tests (a job can pass with zero). ## Performance claims - -- A claim that a change is faster or uses less memory needs numbers: before and after, on the same - machine, with the hardware, thread count, versions and the command used (see - [benchmarks/AGENTS.md](benchmarks/AGENTS.md)). The ASV suite in `benchmarks/` is the preferred source. -- Results come with a noise estimate (repeat runs or an A/A comparison). Changes inside the noise are not - a speedup. -- Every row of a results table is read, not only the headline: a slowdown in any case is called out and - justified, or fixed. -- When CI publishes benchmark results for the commit, the claim is checked against them. A claim with no - measured number behind it is flagged. -- Benchmark changes keep the DFTI warmup in `setup`, keep imports and setup out of timed code, and use - portable core detection. Changing the thread default or setup invalidates comparison with older results. -- A performance change must not change results. Review it as a behavior change too. +- Before and after on one machine, with hardware, threads and pinning, Python/NumPy/oneMKL versions + and the command (ASV preferred). Results must not change: review it as a behavior change too. +- Noise is measured (repeats or A/A); a gain inside it is no speedup. "Unchanged" needs numbers too. +- Read every table row; any slowdown is called out and justified, or fixed. Memory or "one copy + fewer" claims are shown by `peakmem_*` benchmarks or a test. +- Benchmark edits keep the DFTI warmup in `setup`, setup and imports out of timed code, portable core + detection. Changing the thread default or setup breaks comparison with old results. ## C backend and Cython - -- Edit `mkl_fft/src/*.c.src` templates, not generated C. -- Every allocation and DFTI call has its failure path checked, with no leak and a Python exception set. -- The GIL is released only around code that touches no Python objects, consistently across the - contiguous and strided paths. -- Avoid bare `except:`; catch the specific error. -- Reuse existing helpers (for example the argument handling in `_fft_utils.py`) rather than copying logic. +- Edit `mkl_fft/src/*.c.src` templates, never generated C. Every allocation and DFTI call has a + checked failure path: no leak, Python exception set. +- The GIL is released only around code touching no Python objects, alike in contiguous, strided, 1-D + and N-D paths. +- Update asserts and comments whose invariant the change breaks. No bare `except:`. Reuse helpers + (`_cook_nd_args`, `_fft_utils.py`); do not copy logic. ## Packaging and CI - -- Dependency floors in `conda-recipe*/meta.yaml` agree with `pyproject.toml`; numpy compatibility comes - from its `run_exports`, not from ignoring them. -- On macOS each runtime path is its own `-Wl,-rpath` argument. -- Free-threaded Python builds keep the classifier and build pins that support them. -- Any OpenMP or threading library the build links is one the recipe actually ships at run time. -- Formatters and linters exclude `*.c.src` templates and `_vendored/`; formatting a template breaks its - `@name@` placeholders. -- GitHub Actions are pinned to a full commit SHA with a matching version comment. +- `conda-recipe*/meta.yaml` floors match `pyproject.toml`; NumPy compatibility comes from `run_exports`. +- macOS: one `-Wl,-rpath` per path. Free-threaded builds keep their classifier and pins. Any OpenMP or + threading library linked is shipped by the recipe. +- Formatters skip `*.c.src` (they break `@name@` placeholders) and `_vendored/`. Actions are pinned + to a full commit SHA with a matching version comment. ## Automated pull requests - -Pull requests opened by an automated agent (their description starts with "This pull request is entirely -AI-generated") get the full review above, plus these checks. The agent writes code from reading the -source and runs only the pre-commit hooks; it does not build, run tests or measure anything, so the code -has not run until CI has. Maintainers may later push commits or edit the description of such a pull -request, so check who wrote each commit and each claim. - -- **One change.** The pull request does exactly one optimization or one bug fix, never both, and touches - only `mkl_fft/` sources and `mkl_fft/tests/`. Changes to build files, recipes, workflows, benchmarks, - `CHANGELOG.md` or generated C are out of scope and are flagged. -- **Fix needs a failing test.** A `fix:` pull request adds a test that fails on the base branch and - passes with the fix. Confirm from CI that it fails without the fix; a test that also passes on the base - branch is not a regression test. -- **Speedup needs a number.** A `perf:` pull request states a mechanism, not a measurement. Accept it - only when the benchmark run attached to the pull request shows the gain beyond noise, with no slowdown - in other cases. Without that run the change is not proven faster. -- **Behavior is unchanged.** A `perf:` change must keep results identical for every dtype, shape, - stride, `out=`, `s=`, `axes=` and `norm`. Check the cases in [Correctness](#correctness) against the code. -- **Tests are not weakened.** No test function removed, no new `skip` or `xfail`, no loosened tolerance - or changed expected value without the upstream NumPy/SciPy behavior that justifies it. Verify that - upstream behavior yourself. -- **Rule files.** An edit to any `AGENTS.md`, `REVIEW.md` or `.github/copilot-instructions.md` changes - the rules future automated runs follow. Review it as a policy change, separately from the code. -- **Known risk spots.** Past automated changes went wrong in the check deciding whether oneMKL writes - into `out=` directly (wrong array checked: wrong values and writes outside `out`), in integer counts - checked on one dimension only, and in benchmark tables hiding a slowdown in one row. -- **Text.** The description lists the changed paths and a short motivation, with no agent narration. - The agent itself claims no numbers; any measured numbers added later state who measured them, on - what machine and with which command. +Automated = opened by `intel-python-devops` from a `chore/agentic-sweep-*` branch, or described as +"This pull request is entirely AI-generated". The agent only reads source and runs pre-commit; nothing +is built, tested or measured until CI. Maintainers often push commits and edit text later: check who +wrote each commit and claim, and review the current state. Everything above applies, plus: + +- One change: one optimization or one fix. Flag agent commits outside `mkl_fft/` and `mkl_fft/tests/` + (build files, recipes, workflows, benchmarks, generated C). A maintainer adds `CHANGELOG.md` entries. +- `fix:` needs a test failing on base. `perf:` is only a mechanism until a benchmark shows the gain + beyond noise with no slowdown elsewhere, and a test shows results unchanged. +- No weakened tests: no removed test, new `skip`/`xfail`, looser tolerance or changed expected value + unless upstream NumPy/SciPy behavior justifies it and you verified that behavior yourself. +- Edits to `AGENTS.md`, `REVIEW.md` or `.github/copilot-instructions.md` change future runs' rules: + review them as policy, separately from code. +- Known risk spots: the `out=` direct-write check, `MKL_INT` on one dimension, a slowdown in one row. +- Text: no agent narration. The agent claims no numbers; numbers added later say who measured, where + and how. Title and description match the final scope. ## Pull request text - -- `CHANGELOG.md` has an entry under the `[dev]` section with a working link to the pull request and to - every issue it fixes. -- The description states what changed, why, and the evidence. It contains no tool or agent scaffolding - text (prompts, "mandates", notes about reading instruction files). +- User-visible changes (behavior, API, packaging, build output, measured speedup) get a `CHANGELOG.md` + entry under `## [dev]` with `[gh-NNN](https://github.com/IntelPython/mkl_fft/pull/NNN)` links to + the pull request and each fixed issue. Docs, tooling and CI-only changes usually need none. +- The description follows the template: what changed, why, what was verified and where, what was not. + No agent scaffolding (prompts, "mandates", notes about reading instruction files). From 108c9c4ab53e133acfc71a6ea96e9e6aba1e5ed9 Mon Sep 17 00:00:00 2001 From: vchamarthi Date: Thu, 19 Nov 2026 14:12:48 -0600 Subject: [PATCH 4/5] REVIEW.md: drop names that change over time Refer to the automation account, build commands, helper functions, benchmark names and changelog format by role or by their source of truth (CONTRIBUTING.md) instead of naming them. Signed-off-by: vchamarthi --- REVIEW.md | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/REVIEW.md b/REVIEW.md index df24b2c1..858399dd 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -7,12 +7,11 @@ and Automated pull requests when it applies. Each rule is a check: flag a failur ## How to verify Say which of these you ran, and on what platform. -1. Build `pip install -e . --no-build-isolation` (CONTRIBUTING.md, Development setup), then run - `pytest mkl_fft/tests` and `pre-commit run --all-files`. A fix's new test must fail on base. +1. Build, test and lint with the commands in CONTRIBUTING.md. A fix's new test must fail on base. 2. For performance, run base against base (A/A) for noise, then base against the pull request, with the ASV modules in `benchmarks/` that exercise the changed path (see `benchmarks/AGENTS.md`). -3. Reference is NumPy's own FFT. If `numpy.fft.fft.__module__` names `mkl_fft` (Intel-channel NumPy), - use `numpy.fft._pocketfft`. +3. Reference is NumPy's own FFT. Some NumPy builds come with `numpy.fft` already patched to `mkl_fft` + (check `numpy.fft.fft.__module__`); then compare against NumPy's unpatched implementation. ## Correctness - Same values, dtype, shape, result memory order (C/F) and errors as `numpy.fft`/`scipy.fft` for the @@ -50,7 +49,7 @@ Say which of these you ran, and on what platform. and the command (ASV preferred). Results must not change: review it as a behavior change too. - Noise is measured (repeats or A/A); a gain inside it is no speedup. "Unchanged" needs numbers too. - Read every table row; any slowdown is called out and justified, or fixed. Memory or "one copy - fewer" claims are shown by `peakmem_*` benchmarks or a test. + fewer" claims are shown by the memory benchmarks or a test. - Benchmark edits keep the DFTI warmup in `setup`, setup and imports out of timed code, portable core detection. Changing the thread default or setup breaks comparison with old results. @@ -59,8 +58,8 @@ Say which of these you ran, and on what platform. checked failure path: no leak, Python exception set. - The GIL is released only around code touching no Python objects, alike in contiguous, strided, 1-D and N-D paths. -- Update asserts and comments whose invariant the change breaks. No bare `except:`. Reuse helpers - (`_cook_nd_args`, `_fft_utils.py`); do not copy logic. +- Update asserts and comments whose invariant the change breaks. No bare `except:`. Reuse existing + helpers rather than copying logic. ## Packaging and CI - `conda-recipe*/meta.yaml` floors match `pyproject.toml`; NumPy compatibility comes from `run_exports`. @@ -70,26 +69,26 @@ Say which of these you ran, and on what platform. to a full commit SHA with a matching version comment. ## Automated pull requests -Automated = opened by `intel-python-devops` from a `chore/agentic-sweep-*` branch, or described as -"This pull request is entirely AI-generated". The agent only reads source and runs pre-commit; nothing -is built, tested or measured until CI. Maintainers often push commits and edit text later: check who +Automated = opened by the repository's automation account, or marked as AI-generated in its +description. Unless the pull request shows otherwise, assume the agent did not build, test or measure: +nothing has run until CI. Maintainers often push commits and edit text later: check who wrote each commit and claim, and review the current state. Everything above applies, plus: - One change: one optimization or one fix. Flag agent commits outside `mkl_fft/` and `mkl_fft/tests/` (build files, recipes, workflows, benchmarks, generated C). A maintainer adds `CHANGELOG.md` entries. -- `fix:` needs a test failing on base. `perf:` is only a mechanism until a benchmark shows the gain - beyond noise with no slowdown elsewhere, and a test shows results unchanged. +- A fix needs a test failing on base. A performance change is only a mechanism until a benchmark + shows the gain beyond noise with no slowdown elsewhere, and a test shows results unchanged. - No weakened tests: no removed test, new `skip`/`xfail`, looser tolerance or changed expected value unless upstream NumPy/SciPy behavior justifies it and you verified that behavior yourself. -- Edits to `AGENTS.md`, `REVIEW.md` or `.github/copilot-instructions.md` change future runs' rules: - review them as policy, separately from code. +- Edits to agent rule files (`AGENTS.md`, `REVIEW.md` and other agent instruction files) change + future runs' rules: review them as policy, separately from code. - Known risk spots: the `out=` direct-write check, `MKL_INT` on one dimension, a slowdown in one row. -- Text: no agent narration. The agent claims no numbers; numbers added later say who measured, where - and how. Title and description match the final scope. +- Text: no agent narration. Every number says who measured it, where and how. Title and description + match the final scope. ## Pull request text - User-visible changes (behavior, API, packaging, build output, measured speedup) get a `CHANGELOG.md` - entry under `## [dev]` with `[gh-NNN](https://github.com/IntelPython/mkl_fft/pull/NNN)` links to - the pull request and each fixed issue. Docs, tooling and CI-only changes usually need none. + entry in the format CONTRIBUTING.md gives, linking the pull request and each fixed issue. Docs, + tooling and CI-only changes usually need none. - The description follows the template: what changed, why, what was verified and where, what was not. No agent scaffolding (prompts, "mandates", notes about reading instruction files). From 2885c9c5a826d1d90c5ae5161df7621862e72358 Mon Sep 17 00:00:00 2001 From: vchamarthi Date: Thu, 19 Nov 2026 14:48:53 -0600 Subject: [PATCH 5/5] REVIEW.md: review performance changes from the code, numbers confirm Signed-off-by: vchamarthi --- REVIEW.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/REVIEW.md b/REVIEW.md index 858399dd..21e54dd3 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -45,7 +45,12 @@ Say which of these you ran, and on what platform. - The CI job meant to cover the change ran its tests (a job can pass with zero). ## Performance claims -- Before and after on one machine, with hardware, threads and pinning, Python/NumPy/oneMKL versions +- Judge the change first, from the code: does the mechanism remove real cost on the changed path, how + large is that cost next to the transform, for which sizes and dtypes does it matter, and is there a + simpler or more effective fix? A claim the code does not support (for example, a description naming + a technique the code does not use) is flagged whether or not numbers exist. +- Numbers confirm that judgement, they do not replace it: before and after on one machine, with + hardware, threads and pinning, Python/NumPy/oneMKL versions and the command (ASV preferred). Results must not change: review it as a behavior change too. - Noise is measured (repeats or A/A); a gain inside it is no speedup. "Unchanged" needs numbers too. - Read every table row; any slowdown is called out and justified, or fixed. Memory or "one copy @@ -76,8 +81,10 @@ wrote each commit and claim, and review the current state. Everything above appl - One change: one optimization or one fix. Flag agent commits outside `mkl_fft/` and `mkl_fft/tests/` (build files, recipes, workflows, benchmarks, generated C). A maintainer adds `CHANGELOG.md` entries. -- A fix needs a test failing on base. A performance change is only a mechanism until a benchmark - shows the gain beyond noise with no slowdown elsewhere, and a test shows results unchanged. +- A fix needs a test failing on base. A performance change is reviewed as code: whether its + mechanism can give the claimed gain, whether results stay identical, and whether a better change + exists. Its benchmark, when present, is read against that judgement (gain beyond noise, no slowdown + elsewhere); when absent, say which measurement would settle it. - No weakened tests: no removed test, new `skip`/`xfail`, looser tolerance or changed expected value unless upstream NumPy/SciPy behavior justifies it and you verified that behavior yourself. - Edits to agent rule files (`AGENTS.md`, `REVIEW.md` and other agent instruction files) change