Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c873e12
feat(Geom): AdjPairTracked infrastructure — fillRegistry, device view…
harryzhou2000 Apr 27, 2026
4fc68f2
plan for distributed design
harryzhou2000 Apr 27, 2026
f1fb769
chore(tooling): unify clang-tidy/clang-format configs and add Python …
harryzhou2000 Apr 27, 2026
2d5257c
style: apply clang-format across DNDS/ and drifted Euler/Solver headers
harryzhou2000 Apr 27, 2026
7fbad6f
docs(dev): clang-tidy cleanup plan, and fix summary regex in driver
harryzhou2000 Apr 27, 2026
ac73535
refactor(DNDS): silence bugprone-macro-parentheses false positives
harryzhou2000 Apr 27, 2026
7502b8d
fix(tooling): serialize --fix in run_clang_tidy.py
harryzhou2000 Apr 27, 2026
cd93e2e
refactor(DNDS): add [[nodiscard]] to const getters (modernize-use-nod…
harryzhou2000 Apr 27, 2026
842fb76
refactor(DNDS): initialize locals before write (cppcoreguidelines-ini…
harryzhou2000 Apr 27, 2026
583c468
chore(tooling): disable cppcoreguidelines-missing-std-forward, fix YA…
harryzhou2000 Apr 27, 2026
231af81
refactor(DNDS): rename reserved identifiers (bugprone-reserved-identi…
harryzhou2000 Apr 27, 2026
baa2e07
chore(tooling): apply the KA-bucket clang-tidy disables
harryzhou2000 Apr 27, 2026
1880d48
refactor(DNDS): close rule-of-five gaps (cppcoreguidelines-special-me…
harryzhou2000 Apr 28, 2026
9c71e4b
chore(tooling): disable cppcoreguidelines-macro-usage
harryzhou2000 Apr 28, 2026
742119d
refactor(DNDS): drop redundant casts (readability-redundant-casting)
harryzhou2000 Apr 28, 2026
173ad1a
refactor(DNDS): zero-init raw members (cppcoreguidelines-pro-type-mem…
harryzhou2000 Apr 28, 2026
6c494f4
refactor(DNDS): replace NULL with nullptr (modernize-use-nullptr)
harryzhou2000 Apr 28, 2026
56c43af
refactor(DNDS): use emplace where available (modernize-use-emplace)
harryzhou2000 Apr 28, 2026
9231ae6
refactor(DNDS): prefer = default to empty body (modernize-use-equals-…
harryzhou2000 Apr 28, 2026
7586d2f
refactor(DNDS): qualify auto for pointer / const bindings (readabilit…
harryzhou2000 Apr 28, 2026
0bf9edd
refactor(DNDS): annotate unused parameters (readability-named-parameter)
harryzhou2000 Apr 28, 2026
e07c315
refactor(DNDS): simplify boolean expressions (readability-simplify-bo…
harryzhou2000 Apr 28, 2026
b2019a7
refactor(DNDS): pass by const-ref where copy unused (performance-unne…
harryzhou2000 Apr 28, 2026
9a88b36
refactor(DNDS): range-based for where safe (modernize-loop-convert)
harryzhou2000 Apr 28, 2026
a3cb4a5
refactor(DNDS): prefer member initializer list (cppcoreguidelines-pre…
harryzhou2000 Apr 28, 2026
226ead9
refactor(DNDS): replace C-style casts with named casts (cppcoreguidel…
harryzhou2000 Apr 28, 2026
c407cff
chore(tooling): disable cppcoreguidelines-avoid-non-const-global-vari…
harryzhou2000 Apr 28, 2026
1d60a57
refactor(DNDS): replace C-arrays with std::array (cppcoreguidelines-a…
harryzhou2000 Apr 28, 2026
dd31508
fix(DNDS): guard AdjacencyRow::operator= against self-assign (bugpron…
harryzhou2000 Apr 28, 2026
10f5305
style(DNDS): document intentional branch clones (bugprone-branch-clone)
harryzhou2000 Apr 28, 2026
583ab45
style(DNDS): silence spurious widening warning in Errors.hpp (bugpron…
harryzhou2000 Apr 28, 2026
6c90a62
fix(DNDS): move from rvalue-ref param in ArrayDofDeviceView (cppcoreg…
harryzhou2000 Apr 28, 2026
0d6d0d9
refactor(DNDS): clear long-tail clang-tidy warnings (passes 24-26)
harryzhou2000 Apr 28, 2026
a0f2219
docs(dev): record full clang-tidy session outcome in plan
harryzhou2000 Apr 28, 2026
983b823
docs: record DNDS clang-tidy sanitation status
harryzhou2000 Apr 28, 2026
5ed4ad7
docs(dev): v2 distributed reorder design — dynamic registry, callback…
harryzhou2000 May 4, 2026
0150ec5
feat(DNDS): PermutationTransfer utility for distributed/local row tra…
harryzhou2000 May 4, 2026
f1895aa
feat(Geom): ReorderPlan + ReorderRegistry framework (Phase 2 skeleton)
harryzhou2000 May 4, 2026
a341ba2
feat(Geom): UnstructuredMesh::buildReorderRegistry + ReorderEntities
harryzhou2000 May 4, 2026
8270bf3
feat(Geom): ReorderEntities on real mesh — pull set collection, son r…
harryzhou2000 May 4, 2026
0b51b2f
refactor(Geom): migrate ReorderLocalCells to framework (Phase 3)
harryzhou2000 May 4, 2026
8494156
refactor(Geom): migrate ReadDistributed_Redistribute to framework (Ph…
harryzhou2000 May 4, 2026
e44b992
fix(DNDS): proper move semantics for array types + fix ArrayPair::clo…
harryzhou2000 May 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# DNDSR clang-tidy configuration.
#
# Single source of truth for BOTH command-line clang-tidy runs
# (via scripts/run_clang_tidy.py) AND clangd's in-editor tidy
# diagnostics. The project-root .clangd only adds CompileFlags
# tweaks and no longer carries its own ClangTidy check list;
# clangd discovers this file automatically.
#
# Notes on check selection:
# - "Warning: clang-analyzer-optin.cplusplus.VirtualCall is
# important and should be addressed!" -- historical note kept
# from the original config.
# - The disables mirror (and extend) the list previously carried
# in .clangd's ClangTidy.Remove so CLI and IDE agree.
# - WarningsAsErrors is intentionally empty: tidy runs are
# advisory reports, not build gates. If we later want a CI
# gate, apply it as an overlay config on top of this file.
# - CAUTION: the Checks: block uses YAML folded scalar (>) and
# therefore cannot contain inline '#' comments -- '#' is only a
# comment at the start of a line, and not inside a folded scalar.
# All disable rationales are kept in the table below instead.
#
# Disable rationale (kept out of the Checks: block because YAML
# folded scalars eat '#' as literal text):
#
# -clang-diagnostic-unused-command-line-argument
# Extra flags in compile_commands.json for the tidy pass.
# -modernize-use-trailing-return-type Project style.
# -modernize-type-traits Churn without benefit.
# -modernize-avoid-c-arrays MPI buffers, templates.
# -readability-braces-around-statements Project style.
# -readability-identifier-length Too noisy on math symbols.
# -readability-implicit-bool-conversion Noisy on index/size_t.
# -readability-else-after-return Project style.
# -readability-isolate-declaration Project style.
# -readability-magic-numbers Handled case-by-case.
# -readability-math-missing-parentheses Eigen expressions.
# -readability-convert-member-functions-to-static
# Virtual dispatch patterns.
# -readability-avoid-nested-conditional-operator
# Short ternaries OK.
# -bugprone-easily-swappable-parameters Dimension-tuple APIs.
# -bugprone-casting-through-void Needed for MPI types.
# -performance-avoid-endl Style-only.
# -performance-enum-size Negligible in practice.
# -cppcoreguidelines-missing-std-forward T&& functor params are
# called in-place and
# must not be moved from;
# false positives dominate.
# -cppcoreguidelines-non-private-member-variables-in-classes
# Project uses struct-of-
# fields as data bags
# pervasively.
# -cppcoreguidelines-avoid-magic-numbers Duplicate of the already-
# disabled readability-
# magic-numbers.
# -cppcoreguidelines-pro-bounds-pointer-arithmetic
# -cppcoreguidelines-pro-bounds-array-to-pointer-decay
# -cppcoreguidelines-pro-bounds-constant-array-index
# CSR storage and MPI byte
# buffers are fundamentally
# pointer arithmetic.
# -cppcoreguidelines-pro-type-vararg MPI / printf-family APIs.
# -cppcoreguidelines-pro-type-reinterpret-cast
# MPI byte buffers,
# serialization.
# -cppcoreguidelines-pro-type-const-cast C-API interop (MPI, CGNS,
# HDF5).
# -readability-redundant-access-specifiers
# Repeated public: is a
# project convention for
# large classes.
# -modernize-use-transparent-functors Eigen expression
# templates break with
# std::less<> etc.
# -cppcoreguidelines-c-copy-assignment-signature
# Duplicate of
# misc-unconventional-assign-
# operator, and we already
# follow the canonical form.
# -cppcoreguidelines-macro-usage All 41 macros in DNDS
# require __FILE__/__LINE__
# capture, token pasting,
# code generation, or
# define-before-include
# behaviour that constexpr
# template functions cannot
# express. Examples:
# DNDS_assert*, DNDS_check_throw* (need line info)
# DNDS_DECLARE_CONFIG, DNDS_FIELD, DNDS_json_to_config (code gen)
# DNDS_NLOHMANN_DEFINE_* (nlohmann_json DSL)
# pybind11_bind_Array_All_X_* (name-based pybind11 generator)
# DNDS_DEVICE_TRIVIAL_COPY_DEFINE* (declare class members)
# DNDS_ARRAY_OP_SWITCHER (device/backend dispatch)
# DNDS_likely / DNDS_unlikely / DNDS_FORCEINLINE (builtins/attrs)
# DISABLE_WARNING (_Pragma wrappers)
# MPICH_SKIP_MPICXX, OMPI_SKIP_MPICXX,
# EIGEN_DONT_PARALLELIZE (define-before-include)
# DNDS_VERSION_STRING (from CMake configure_file).
# -cppcoreguidelines-avoid-non-const-global-variables
# Every DNDS global mutable
# is intentional:
# logStream — runtime log redirection
# useCout — runtime switch
# outputDelim — global config
# HDF_mutex — library-wide mutex (must be mutable)
# isDebugging — runtime debugger-attach probe
# EigenPCH_tag,
# ExprtkPCH_tag — PCH presence probes
# Moving any of these to
# thread_local, singletons,
# or class members is out of
# scope for a tidy pass.
#
# Notes on ExtraArgs:
# - -UDNDS_USE_OMP: skip #include <omp.h> which requires
# libomp-<ver>-dev matched to the tidy/clangd clang version.
# - -Wno-unknown-warning-option: our Warnings.hpp uses GCC-only
# warning names inside GCC pragmas (e.g. -Wclass-memaccess);
# clang warns on these and -Werror would turn them into errors.
# - -Wno-unused-command-line-argument: compile_commands.json
# sometimes carries flags irrelevant for the tidy pass.

Checks: >
modernize-*,
readability-*,
bugprone-*,
performance-*,
cppcoreguidelines-*,
google-build-using-namespace,
mpi-*,
openmp-*,
-clang-diagnostic-unused-command-line-argument,
-modernize-use-trailing-return-type,
-modernize-type-traits,
-modernize-avoid-c-arrays,
-readability-braces-around-statements,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-else-after-return,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-math-missing-parentheses,
-readability-convert-member-functions-to-static,
-readability-avoid-nested-conditional-operator,
-bugprone-easily-swappable-parameters,
-bugprone-casting-through-void,
-performance-avoid-endl,
-performance-enum-size,
-cppcoreguidelines-missing-std-forward,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-const-cast,
-readability-redundant-access-specifiers,
-modernize-use-transparent-functors,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-avoid-non-const-global-variables,

WarningsAsErrors: ''

HeaderFilterRegex: '.*/DNDSR/(src|app|test/cpp)/.*'

ExtraArgs:
- -UDNDS_USE_OMP
- -Wno-unknown-warning-option
- -Wno-unused-command-line-argument

CheckOptions:
- key: readability-function-cognitive-complexity.Threshold
value: 125

FormatStyle: file
36 changes: 36 additions & 0 deletions .clang-tidy-fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# DNDSR clang-tidy "fix" profile.
#
# A narrow, low-risk subset of checks intended to be run with
# --fix / --fix-errors to make safe mechanical improvements in
# bulk. Use via:
#
# scripts/run_clang_tidy.py --fix [scope ...]
#
# Anything that requires judgement belongs in .clang-tidy instead,
# not here.

Checks: >
-*,
modernize-use-nodiscard,
modernize-use-equals-default,
modernize-use-using,
modernize-concat-nested-namespaces,
modernize-use-auto,
readability-make-member-function-const,
readability-uppercase-literal-suffix,
readability-qualified-auto,

WarningsAsErrors: ''

HeaderFilterRegex: '.*/DNDSR/(src|app|test/cpp)/.*'

ExtraArgs:
- -UDNDS_USE_OMP
- -Wno-unknown-warning-option
- -Wno-unused-command-line-argument

CheckOptions:
- key: readability-function-cognitive-complexity.Threshold
value: 125

FormatStyle: file
57 changes: 21 additions & 36 deletions .clangd
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# clangd configuration for DNDSR
#
# OpenMP: clangd needs libomp-<ver>-dev to parse omp.h. If not installed,
# -UDNDS_USE_OMP below makes the #ifdef guard skip it. Install with e.g.:
# apt install libomp-18-dev (for clangd-18)
# This file only configures the editor-time behaviour that cannot
# live in .clang-tidy:
#
# CUDA: The CMake build adds -I<CUDAToolkit>/include via CMAKE_CUDA_FLAGS
# so that compile_commands.json always contains the path, even for .cu
# entries where nvcc would normally add it implicitly. clangd's Remove
# list strips the nvcc-only flags so clang can parse the rest.
# - CompileFlags: tweak the flags clangd feeds to the clang
# frontend (strip CUDA/nvcc-only flags, disable OpenMP parsing
# when libomp-<ver>-dev is missing, etc.).
# - Diagnostics.Suppress: silence frontend warnings that are
# noisy in normal DNDSR code (unused params, etc.).
#
# The clang-tidy check list lives in /.clang-tidy at the project
# root and is used unchanged by both clangd and the scripts in
# scripts/run_clang_tidy.py. Do NOT duplicate it here.
#
# OpenMP: clangd needs libomp-<ver>-dev to parse omp.h. If missing,
# -UDNDS_USE_OMP below skips the #ifdef guard. Install with e.g.:
# apt install libomp-18-dev # for clangd-18
#
# CUDA: The CMake build adds -I<CUDAToolkit>/include via
# CMAKE_CUDA_FLAGS so that compile_commands.json always contains
# the path, even for .cu entries where nvcc would normally add it
# implicitly. The Remove list below strips nvcc-only flags so
# clang can parse the rest.

CompileFlags:
Add: [
Expand Down Expand Up @@ -36,32 +50,3 @@ Diagnostics:
unused-variable,
unused-command-line-argument,
]
ClangTidy:
Remove: [
readability-math-missing-parentheses,
modernize-use-trailing-return-type,
readability-braces-around-statements,
readability-identifier-length,
readability-implicit-bool-conversion,
readability-else-after-return,
readability-isolate-declaration,
bugprone-easily-swappable-parameters,
performance-avoid-endl,
bugprone-casting-through-void, # for MPI types...
performance-enum-size,
modernize-type-traits,
modernize-avoid-c-arrays,
readability-magic-numbers,
readability-convert-member-functions-to-static,
readability-avoid-nested-conditional-operator,
]
Add: [
modernize-*,
readability-*
bugprone-*,
performance-*,
cppcoreguidelines-*
google-build-using-namespace,
mpi-*,
openmp-*,
]
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,19 @@ Quick reference for Python:
- `snake_case` functions/variables; C++ wrapper classes match C++ name
- Plain `assert`; `@pytest.fixture` for MPI; numpy for array comparisons

### Clang-tidy sanitation

DNDS is clean as of 2026-04-29 (26-pass cleanup, 24 597 → 1
diagnostics; the remaining one is an unrelated Eigen PCH
`omp.h` include issue). Full per-pass record, `.clang-tidy`
disable rationale, and NOLINT placement gotchas:
**`docs/dev/clang_tidy_plan.md`**.

Other modules (`Solver`, `Geom`, `CFV`, `Euler`, `EulerP`) are
not yet sanitised. Apply the same recipe in that order. Run
`scripts/run_clang_tidy.py <module>` to get the per-check
histogram; the `.clang-tidy` disables carry forward unchanged.

## Geom Module Architecture

Mesh connectivity, ghost management, and the build pipeline are documented
Expand Down
Loading
Loading