Branch dev is the integration branch for micro-opts. main is stable (712 routines). PRs target dev.
- Branch
git checkout -b feat/my-opt dev(notmain). - Check ref
numpy-reference/reference/generated/numpy.<func>.html— match Python signature exactly (seeAGENTS.md). - Implement in
include/np/<module>.hppwith DoxygenReference:link andNP_API. - Test
tests/test_<module>.cppusingtests/test_util.hpp(test::check,approx). - Format
clang-format -i include/np/*.hpp—.clang-format: 4-space, custom Allman-style braces,ColumnLimit: 120,UseTab: Never. - Build
cmake -S . -B build && cmake --build build -j8 && ctest --test-dir build --output-on-failure— must be 49/49. - Commit
feat(module): ...withfile:line(e.g.ndarray.hpp:3116). One logical task per commit, nobuild/artifacts (CMakeCache.txt,build/are in.gitignore). - PR to
dev— include bench delta if perf-related (seePERFORMANCE.md).
- Guard fast path with
if (is_contiguous()) [[likely]]+ fallbackOdometer/_flat_logicalfor views. - Use
T* __restrictforvector<T>::data()(exceptvector<bool>proxy —if constexprfallback). reservevectors beforepush_back;[[unlikely]]on throw paths.std::memcpyonly when same shape +is_contiguous()+offset==0.- Hash threshold
64forisin(empirical);BLOCK=32fordot. - Threadpool via
NP_USE_THREADING—parallel_forthreshold>4096. - Add
[[nodiscard]],noexceptwhere appropriate.
snake_casefuncs,PascalCasetypes, Allman braces,NP_API/NP_NODISCARD.- Include guards
#ifndef NP_<NAME>_HPP. - Namespace
np(subnp::linalg,np::datetime,np::testing).
- Update
README.md(dev badge) anddocs/*.mdwhen adding routines. - Keep
file:linein doc tables greppable. - Run
cmake --build build --target bench_mathfor perf docs.
See AGENTS.md and ARCHITECTURE.md for layout (include/np/detail/* for proxy.hpp, expr.hpp).
dev → main squash after 49/49 + clang-format clean. Tag vX.Y-dev for bench.