You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Symbols generated by Devito should be generated using a symbol registry #2292
Symbols generated within Devito currently do not have guaranteed unique names, potentially producing inadvertent clashes which result in cryptic errors being raised.
Devito currently makes use of counters (among other means) to create unique names for internally-generated symbols. However, there is nothing preventing clashes either with other generated symbols or those defined by the user.
It would be beneficial to have a registry of symbols to generate unique names in a consistent manner, to be used throughout the codebase.
This functionality could potentially be introduced as a mixin class where needed.
Possible approach:
@cached_property
def name(self):
if self._name is None:
return compute_deterministic_hash(self._hashable_content()))
else:
return self._name
or alternatively when setting name:
self._name = self._registry.get_unique_name(name)
where get_unique_name adds an increment to the supplied name as required.
compiler: Preserve compilation invariants under symbol renaming #3084 (open) adds SymbolRegistry.reserve: at Operator construction the registry records every free symbol and Function name of the input expressions, and make_name skips reserved names and records each name it hands out, so compiler-generated temporaries no longer collide with application symbols such as r0.
Once #3084 merges, what remains of this issue is the DSL side: symbols created outside the compilation registry (derived dimensions and other user-facing objects) still pick their names through their own counters.
Activity
ggorman commentedon Oct 22, 2026
Cross-references, since none of the related PRs cite this issue:
SymbolRegistry.reserve: at Operator construction the registry records every free symbol and Function name of the input expressions, andmake_nameskips reserved names and records each name it hands out, so compiler-generated temporaries no longer collide with application symbols such asr0.Once #3084 merges, what remains of this issue is the DSL side: symbols created outside the compilation registry (derived dimensions and other user-facing objects) still pick their names through their own counters.