Docs: Record four agent conventions that only lived in review libeigen/eigen!2964 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
diff --git a/.agents/benchmarking.md b/.agents/benchmarking.md index ede4052..9ad3fc4 100644 --- a/.agents/benchmarking.md +++ b/.agents/benchmarking.md
@@ -52,10 +52,9 @@ - `Range`, `DenseRange`, or `Ranges` for swept dimensions. - `ArgsProduct({{...}, {...}})` for Cartesian products. -Use `Apply()` only for a genuinely computed grid that these APIs cannot express. In that exceptional case, match the -Google Benchmark version used by the project and note that the callback currently names -`benchmark::internal::Benchmark*`, an internal API. Prefer an existing local pattern and keep the grid-generation -function small and deterministic. +Do not use `Apply()`. Its callback is typed on `benchmark::internal::Benchmark*`, a library-internal name that +benchmark sources must not reference. A grid that appears to need it is expressible by enumerating the points in +`ArgsProduct` or `Args`, or by registering several benchmarks. ## Running Measurements
diff --git a/.agents/conventions.md b/.agents/conventions.md index 6e12aa1..8c33cab 100644 --- a/.agents/conventions.md +++ b/.agents/conventions.md
@@ -10,7 +10,13 @@ - Trait and evaluator constants are `static constexpr` members, not `enum` blocks; `enum` constants are being phased out. Give each the type it is used as: `Flags` is `unsigned int` by convention, predicates are `bool`. - Prefer `using` to `typedef`, `nullptr` to `NULL`, `= default` and default member initializers to empty constructor - bodies that assign each member. + bodies that assign each member. `using` binds in every tree, `test/` and `unsupported/` included: those were left + out of the sweep that converted `Eigen/src`, so the aliases surrounding new code there are mostly still `typedef` + and matching the neighbours reproduces the form the sweep removed. Do not rely on CI to catch it — the + `modernize-use-using` gap recorded at [`scripts/check_style.py`](../scripts/check_style.py) leaves function-local + typedefs unreported. +- `kCamelCase` is an accepted spelling for `static constexpr` and static constants, alongside the older `snake_case` + and `SCREAMING_CASE` forms. It is not a review finding. - Use `numext::` math functions rather than `std::` in library code, and Eigen's metaprogramming aliases (`bool_constant`, `void_t`, `remove_all_t`; see `Eigen/src/Core/util/Meta.h`) rather than spelling out the standard forms. `internal::is_arithmetic` is not a spelling of `std::is_arithmetic`: it is deliberately specialized for
diff --git a/.agents/testing.md b/.agents/testing.md index b21c076..18a283f 100644 --- a/.agents/testing.md +++ b/.agents/testing.md
@@ -167,6 +167,11 @@ model as appropriate. Check NaN, infinity, and signed zero explicitly when their distinction matters. Follow [`numerics.md`](numerics.md) for solver, packet, and scalar-math coverage. +Write such a bound as `factor * NumTraits<RealScalar>::epsilon()` at the site, and explain `factor` by its error +model. Do not introduce tolerance wrapper helpers: the raw form is the established idiom across `test/` and +`unsupported/test/`, and it *is* the computation, so a bound like `10 * n * eps * A.norm()` stays readable as one. +A bare decimal literal is worse than opaque — `1e-9` demands impossible accuracy from a `float` instantiation. + Two ways a comparison silently accepts everything, both of which have shipped here: a tolerance computed by the operation under test (a bound formed as `(A.cwiseAbs() * B.cwiseAbs())` goes through the product code being tested — accumulate it independently instead), and a comparison that admits non-finite values (`error <= tolerance` holds for
diff --git a/AGENTS.md b/AGENTS.md index 8e43d19..426590d 100644 --- a/AGENTS.md +++ b/AGENTS.md
@@ -86,6 +86,11 @@ A posted code suggestion is a sketch that has not been compiled; verify it like your own work before adopting it — including the C++14 baseline, `Matrix`/`Array` and expression-type mismatches, and numerically deliberate groupings. +Reproduce a claimed defect before fixing it, and judge the suggested remedy separately from the finding: a real bug +often arrives with a fix that breaks cases the current code handles. Hold your own claims to the same standard — +a behavioral claim is established by reading the function body and the branch actually taken, never by a header's +own Doxygen, which can be stale or describe an adjacent case; confirming that a path or symbol exists proves nothing +about behavior, and universals need enumeration rather than inference from a few instances. Address every thread: apply the suggestion or explain the deviation, naming the commit that resolved it. Keep the response within the comment's scope; a defect it exposes in shared code belongs in its own commit or merge request. After each round, re-verify that the merge request description and commit messages still describe the current head.