Skip to content

Reserve derived names (<sv>_residual / _jacobian / _out) against output/symbol collisions #79

Description

@petlenz

Follow-up from PR #78 round-2 review (architect Q B).

assert_symbol_name_available / assert_output_name_available now reject a symbol and an output sharing a RAW name (either declaration order). But they don't reserve the derived names the codegen synthesises:

  • <sv>_residual / <sv>_jacobian (TimeIntegrationPass / LocalJacobianPass outputs)
  • <sv>_old (state-variable paired symbol — partially reserved via the suffix note, but not cross-checked against outputs)
  • <name>_out (generated function out-params)

So e.g. a user output literally named alpha_residual could collide with the synthesised residual output for a state variable alpha, or an input named x_old could shadow a state-var old symbol. Low likelihood, but it would produce a duplicate property / shadowed symbol in generated code.

Fix: centralise a name-reservation check that also rejects collisions with the derived-name patterns (_residual, _jacobian, _old, _out suffixes against existing bases, and vice versa). Add tests for each collision shape.

Severity: MINOR (not a current-recipe hazard; the obvious clashes are now caught). Tracked so it isn't lost.

Refs: PR #78, issue #77.

Activity

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