Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Name Validation #1661

Merged

Conversation

philip-paul-mueller
Copy link
Collaborator

This PR adds checks to the SDFG to ensures that names from symbols, data descriptors and so on are unique.
Furthermore, it also ensures that the NestedSDFG validates correctly and ensures that no symbols can be written.

…array}` functions.

These check ensures that there is no name dublication and all names are unique.
In this case it generates a more appropriate error.
It now checks and ensures that the different names (symbols, arrays and so on) are unique.
@philip-paul-mueller philip-paul-mueller marked this pull request as draft September 18, 2024 12:26
This was because where I checked it I did it wrong.
It no longer removes the reference from the array or symbol dict.
It seems that they must exists inside these dicts otherwise there is a validation error.
@philip-paul-mueller
Copy link
Collaborator Author

Let's forget about this thing, it is just not worth it.

philip-paul-mueller and others added 5 commits September 20, 2024 10:59
This commit reworks and unify how the naming is adapted.

Thanks to @alexnick83 for suggesting the solution; Let's hope that this time I got all.
Because it was originally inside a while loop the `find_new_name()` function was actually called multiple times.
First with the "dirty" name, that still contained dots, which was then replaced.
Because the first time the `add_datadesc()` function was called with that name and `find_new_name=True`, the cleaned name was already known.
Thus it would again be passed to `_find_new_name()` but this time the name was cleaned and augmented (because it once passed through `_find_new_name()`).
The code introduces exactly replicated this behviour.
If it should be disabled, then the cleaning and the first call to `_find_new_name()` can be swapped and the if removed.

Note this also means that the original `name` contained dots _and_ was added to `_arrays`.
However, it did not trigger an error in validation, so it is probably fine.
@philip-paul-mueller philip-paul-mueller marked this pull request as ready for review September 20, 2024 12:54
Before the MPI replacement functions created pseudo-scalars with the same name as the corresponding entity, i.e. if there is a process grid with name `__pgrid_1` then there was a scalar with that name.
According to the comment, this scalar is there to prevenbt the removal of some dummy nodes.
However, as a side effect the Python frontend was also finding them and had not to wory about the MPI types, at least in assignment statements.
But because we disallowed that different entities had different names (except for constants) this no longer worked and the frontend had to explicitly handle them.
This commit added the facilities for this.
@philip-paul-mueller philip-paul-mueller added this pull request to the merge queue Sep 24, 2024
Merged via the queue into spcl:master with commit 7df09c7 Sep 24, 2024
10 checks passed
@philip-paul-mueller philip-paul-mueller deleted the better_symbol_checking branch September 24, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants