-
Notifications
You must be signed in to change notification settings - Fork 426
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
internal compiler error UTI-MIS-093 [due to instantiating a type field with an array type] #20050
Comments
[reflecting a response from gitter] I haven't had the chance to see what is causing this internal error, though my guess is that it's running afoul of some aspect of static vs. dynamic types for the array argument in Chapel. If it helps someone get unblocked, I massaged the code into a format that I was fairly confident would work by essentially factoring the runtime types out of the generic fields in record MultiDual {
type t;
var Dom: domain(1);;
var prim: t;
var dual: [Dom] t;
proc init(type t) {
this.t = t;
}
proc init(val, arr) {
this.t = val.type;
this.Dom = arr.domain;
this.prim = val;
this.dual = arr;
}
}
proc gradient(x : [?D] ?t) {
type d = MultiDual(t);
var x0 : [D] d;
forall i in D {
var eps : [D] t = 0.0;
eps[i] = 1.0;
x0[i] = new MultiDual(x[i], eps); // this is line 15
}
return x0;
}
var x = [1.0, 2.0, 3.0];
var a = gradient(x);
writeln(a); |
…ang#20050 In investigating chapel-lang#20050, I found that the cause of the internal error was a NULL dereference, so inserted a check for NULL and a guess as to the cause of the problem. This isn't completely satisfying, but may be more satisfying than an internal error. --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
@lucaferranti — I got back to this today and verified that the internal error does relate to the I also put together #20084 to convert it from an internal error to a user error in a very simple way, which is not particularly satisfying, but at least makes the user experience epsilon better. To see whether they have additional thoughts on this, I'm tagging @mppf because it's his code I've modified, @vasslitvinov because of his role in #11549, and @benharsh as (I believe) the author of the default initializer that's leading to this behavior (not that I'm trying to assign blame in any of those tags... just curious for thoughts about whether to proceed with the PR for now, or try something different). Luca, from subsequent questions you've asked, I've gotten the sense that you've proceeded with workarounds, and that this isn't holding you up (even if it is unsatisfying), but would you let me know if I'm wrong about that? |
yes this is correct, in the end I managed to avoid having to tweak with inner constructors and managed to get past this (and the other internal compiler errors I met across the way). If you are curious, the relevant code of what I was trying to do and how I ended up doing it is here and here |
When compiled with
|
Summary of Problem
Steps to Reproduce
Source Code:
produces
Compile command:
chpl multidual.chpl
Associated Future Test(s):
Configuration Information
chpl --version
:$CHPL_HOME/util/printchplenv --anonymize
:gcc --version
orclang --version
:The text was updated successfully, but these errors were encountered: