Skip to content

FEAT: Add meson build + ctypes/pytest test driver with MPFR oracle - #11

Draft
seiko2plus wants to merge 1 commit into
numpy:mainfrom
seiko2plus:new/test
Draft

FEAT: Add meson build + ctypes/pytest test driver with MPFR oracle#11
seiko2plus wants to merge 1 commit into
numpy:mainfrom
seiko2plus:new/test

Conversation

@seiko2plus

Copy link
Copy Markdown
Member

Top-level meson build compiles each op's test kernels into their own dlopen-able plugin, with Highway as a build-time subproject. The numpy_sr package dlopens the plugins and dispatches over numpy buffers via ctypes; tests are plain pytest.

  • Targets per ISA with ops exposed at module scope (numpy_sr.sin), accuracy= keyword taking Precise() profiles, fenv context manager.
  • Correctly-rounded MPFR reference kernels as oracle.
  • ULP assertion helpers and reusable test-data generators; first suite covers sin/cos.
  • Random test seed by default (NPSR_SEED overrides), shared across xdist workers so all sweep identical data.
  • spin build/test commands
  • CI smoke + stress.

Builds `numpy_sr`: a pybind11 extension exposing one submodule per Highway
target plus two references (an MPFR correctly-rounded oracle and Intel SVML),
driven by a pytest plugin that scores every kernel in fractional ULP.

- meson build behind the `tests` feature; highway and numpy/SVML as subprojects
- vectorized ULP comparators, MPFR ref+residual oracle, FP-exception probe
- suite covers IEEE specials, parity, tiny identities, fenv discipline, random
  and exhaustive sweeps, an adaptive worst-case hunt, and a frozen worst-case
  book replayed as a regression gate
- `spin test` / `spin ulp-report` wrappers and a static HTML report viewer

precise.h gains `FPExceptions::kInexact` so the harness can name the flag the
kernels deliberately leave unmanaged.
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.

1 participant