ci: add CodeRabbit configuration for AI-assisted MR reviews libeigen/eigen!2472 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..991a717 --- /dev/null +++ b/.coderabbit.yaml
@@ -0,0 +1,115 @@ +# CodeRabbit configuration for Eigen. +# Schema: https://docs.coderabbit.ai/reference/configuration +# +# Eigen is a header-only C++14 template library, GitLab-hosted, with a strict +# ABI policy and several major downstream consumers (notably TensorFlow). The +# settings below favor signal over volume: chill profile, minimal noise on +# auto-generated docs and vendored Fortran, and explicit guidance for the +# template-heavy core. + +language: en-US + +tone_instructions: >- + Eigen, header-only C++14. Focus: correctness, numerical accuracy (SOTA; + flag regressions, defer few-ULP tradeoffs to humans), ABI, performance, + template metaprogramming pitfalls, missing tests. Skip style + nits and C++17+. + +early_access: false +enable_free_tier: true + +reviews: + profile: chill + request_changes_workflow: false + high_level_summary: true + # Post the high-level summary in the walkthrough comment, NOT in the MR + # description. Eigen maintainers want the description left alone. + high_level_summary_in_walkthrough: true + poem: false + review_status: true + collapse_walkthrough: true + + auto_review: + enabled: true + drafts: false + # Eigen MRs often see many WIP pushes; reviewing every push burns the + # per-developer hourly rate limit on the free/OSS tier. Review the first + # diff only; further reviews can be requested with `@coderabbitai review`. + auto_incremental_review: false + base_branches: + - master + + path_filters: + - "!doc/snippets/**" + - "!doc/examples/**" + - "!lapack/*.f" + - "!blas/testing/**" + - "!**/*.png" + - "!**/*.bin" + - "!**/*.svg" + - "!**/*.pdf" + + path_instructions: + - path: "Eigen/src/**" + instructions: | + Eigen is a header-only C++14 template library with a strict ABI policy. + - **Numerical accuracy is a top priority.** Eigen targets accuracy + comparable to established numerical libraries such as LAPACK. Flag + any change that may degrade accuracy, condition handling, stability + under near-singular / ill-conditioned inputs, or behavior near + subnormals, infinities, NaNs, or extreme exponents. In general, + do not trade accuracy for speed. + - **Acceptable accuracy tradeoff:** a faster algorithm whose + worst-case error is bounded to a few ULPs by a principled + analysis may be acceptable. In such cases, surface the tradeoff + and the bound clearly so a human reviewer can judge; do not + auto-approve or auto-reject these. + - **Numerical changes require numerical tests.** Any new numerical + algorithm, kernel, or accuracy-sensitive change MUST come with + tests that exercise its accuracy claims (random ill-conditioned + inputs, edge values, comparisons against a reference). If such + tests are missing, request them. + - Treat the public API surface as frozen: do not propose renames or + signature changes for non-internal types. + - Performance and inlining matter; flag possible regressions in hot + paths (products, packet kernels, evaluators, decompositions). + - Watch for accidental allocations in templates that should be + allocation-free. + - C++14 is the minimum; do not suggest C++17+ features. (A migration + to C++17 is planned on a separate branch; until it lands on master, + new code must compile under C++14.) + - Do not propose reordering internal includes; Eigen relies on a + specific include order. + - path: "test/**" + instructions: | + Tests use the EIGEN_REPEAT-N harness and shard each .cpp into many + ctest targets. Do not suggest restructuring the harness or + deduplicating shards. Numerical-tolerance comparisons are deliberate; + do not push for exact equality. Tests may be long and procedural. + - path: "unsupported/Eigen/**" + instructions: | + Treat unsupported modules as more permissive than core Eigen, but + keep the public API stable for known downstream consumers (the Tensor + module is used by TensorFlow). + - path: "blas/**" + instructions: | + These are Reference BLAS API wrappers around Eigen. Match the BLAS + standard exactly; do not suggest deviating from netlib semantics. + - path: "lapack/**" + instructions: | + The .f sources are vendored netlib LAPACK reference; do not review + them. The C++ wrappers should faithfully implement the LAPACK + contract. + - path: "ci/**" + instructions: | + GitLab CI configuration. Be conservative -- do not suggest + restructuring the existing job graph or changing runner tags without + strong reason. + - path: "benchmarks/**" + instructions: | + Microbenchmarks built against Google Benchmark. Clarity matters less + than realistic measurement; flag only correctness or measurement + methodology issues, not style. + +chat: + auto_reply: true