Skip to content

Umbrella: low-severity findings from the 2026-08-02 full review (F-18 a-i) #144

Open

Description

@petlenz

Grouped low-severity items from the 2026-08-02 full-repo review (finding F-18); split out sub-issues if/when picked up. Pattern follows #14.

  • (a) Dual SymbolDecl storage — inputs/params are copied into m_inputs_cache/m_parameters_cache (recipe.h:339-398); ensure_dt_symbol_registered_ must set is_time_step on both copies (recipe.h:1048-1049). Store indices into m_symbols instead (the codebase already prefers index-over-pointer elsewhere).
  • (b) Role equality is name-only; attribute-mismatch guard covers only the built-in catalogue (recipe.h:73-76, validate_role_attributes 1001-1024). Two custom roles sharing a name with different attributes silently coexist. Track first-seen custom role names per model and reject re-declaration with different attributes.
  • (c) roles:: globals are dynamically initialized — SIOF trap, self-documented at recipe.h:84-89; the examples' registry pattern is one static ConstitutiveModel away. Meyers-singleton accessors would close it (API break — batch with another break).
  • (d) Eager-branch piecewise evaluation — untaken if_then_else branch still evaluates (NaN hazard for guarded inv/log/sqrt); documented at tensor_code_emit.h:160-167. Fix requires statement-level branch lowering; keep on the roadmap (interacts with Local-Newton robustness: detect non-convergence + guard singular Jacobian (scalar + coupled) #85's NaN policy).
  • (e) HeaderPurity is a substring grep (cmake/check_header_purity.cmake:38-45) — matches comments (false-positive class) and does not test self-containment (false-negative class). Add a per-header lone-TU compile target; all public headers currently pass (verified g++-14/C++23), so it starts green.
  • (g) Default LA policy defaulted in 3+ places — recipe.h:677, recipe_render.h:115, CodeEmitPass fallback pass_bodies.h:592-594, per-target ctors. Make PassContext::linear_algebra unconditionally set in one place; drop the fallback.
  • (h) Document copy semantics of ConstitutiveModel — copies share cas leaf nodes (safe today since leaf mutation happens only at declaration time — but a latent trap for future post-copy mutation), and state-variable handles do not rebind to copies (model_token check).
  • (i) API polish — dead type param on CodeGenContext::emit_temporary (codegen_context.h:68); duplicate Kind enums (recipe.h:130 vs 271); auto const&-returning public accessors hide their types (recipe.h:895-901); target-factory triple sync (names vector / if-chain / default constant) → one static table.

(f) install-rule gating + LICENSE install was filed with the packaging issue #133.

Activity

  1. petlenz commented on Aug 2, 2026

    @petlenz
    MemberAuthor

    Three additions from the PR-batch critical review (2026-08-02):

    • (j) CI job hygiene: no timeout-minutes on the workflow jobs (360-min default; the ASan leg is the one to watch), and GitHub auto-disables schedule: workflows after 60 days of repo inactivity (email warning first) — worth knowing rather than fixing, but a timeout-minutes: 45 per job is one line each.
    • (k) Dead complex-constant branch: ScalarCodeEmit's std::complex<double> branch is unreachable at the current cas pin — make_expression<scalar_constant>(std::complex<...>) throws "complex values are not supported" at construction (discovered while trying to test it; documented in ScalarCodeEmitTest.cpp). Either keep as defensive dead code (current state, format+non-finite-guard hardened) or remove when convenient.
    • (l) Consistent-tangent negation e2e case: numsim_material.cpp:617 constructs a raw scalar_constant(-1.0) on the tangent path; today it only reaches the emitter as a mul leaf, so the Negation emitters can emit '--5.0' (invalid C++) for a bare negative constant — add paren guard #136 paren guard never fires there — incidental to the shipped recipes' shape, not structural. A NumSimMaterialTarget test with a residual whose dR/dz wraps that node in scalar_negative would pin the interaction end-to-end (the visitor-level guards are unit-tested as of PR Parenthesise negation of a leading-minus operand (#136) #147's follow-up).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions