Miscellaneous type inferability fixes#1313
Draft
Antoinemarteau wants to merge 33 commits into
Draft
Conversation
placed a couple of them in order to catch type instability due to user given analytical functions
size of values was wrong for Vector V
- composed OperationField - composed auto-diffed functions - Using Base.Fix as the idiomatic Julia way to ensure sepializing on clojured functions
This caused an issue when composed with `get_polytope(reffe)` which is not type stable. Anotating the return type makes `get_dimrange` type stable anyway.
for models with type-unstable `get_grid_topology`, such as
DiscreteModelPortion struct that has abstract fields, these would
not be infered, nor "constantly unfolded" at compile type.
Instead, I fall back to Grid's default API
when get_grid_topology is not type stable on model, this in necessary for inferrability of return_cache(::NormalSignMap). A better fix would be to concretely type all DiscreteModel (the one that triggered this is DiscreteModelPortion).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1313 +/- ##
==========================================
- Coverage 88.86% 88.76% -0.10%
==========================================
Files 228 228
Lines 30183 30200 +17
==========================================
- Hits 26821 26807 -14
- Misses 3362 3393 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
to avoid breaking changes in 0.20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have been looking at making
array_cachetype inferrable to avoid dynamic dispatches ongetindex!#1303. This require all nestedarray_cacheandreturn_cachepresent in theLazyArrays' operation tree to be inferrable.This PR fixes many type inferrability failures in Gridap and its tests, should be mergable without breaking anything.
I find them using the new
@check_inferredmacro, that usesBase.@inferredto detect them in "debug" mode only.Not many checks are added here cause they break too much stuff, I use this branch to find them, it also contains WIP alternative fix to #1303.
TODO: these are type un-inferrable maps I didn't fix yet, that end up in lazy array cache in the tests:
return_cache(::ConfigMap, x)#1305,(there will be more, I did'nt finish scanning MultiField and Adaptivity).