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
compiled with futhark c from git produces this error:
BuilderT.lookupType: unknown variable d<{s.n}>_5121
Known variables:
f_4499 a_4500 map_5123
CallStack (from HasCallStack):
error, called at src/Futhark/Builder.hs:104:9 in futhark-0.26.0-inplace:Futhark.Builder
The text was updated successfully, but these errors were encountered:
Monomorphisation is probably to blame, as it produces a function with this form:
def f ((s: {n: i64})) : ?[d<{s.n}>].[d<{s.n}>]i64 =
let (d<{s.n}>: i64) = s.n
let f' ((f: i64 -> i64)) ((a: i64)): ?[d<{s.n}>].[d<{s.n}>]i64 =
f'' d<{s.n}> f a
in f' id 0
Note how d<{s.n}> is shadowed in the return type of f. That probably confuses defunctionalisation, which ultimately produces something bad.
This looks a lot more complicated than it ought to. The real bug was a
mishandling of local polymorphic functions in monomorphisation. I
reasoned that there is no reason monomorphisation should ever
encounter those - we should lambda lift those before we monomorphise.
However, that created the need for a bunch of other modifications,
including a new (very small) pass (ApplyTypeAbbrs) that runs just
after defunctorisation.
IT is overall a conceptual simplification, but the code changes look
quite large for such a small bug.
The program
compiled with
futhark c
from git produces this error:The text was updated successfully, but these errors were encountered: