Failing test

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Failing test

Simon Peyton Jones
Iavor

Are these four failures the result of your changes?
Should we fix the tests?

Should the error message say "The instance decl is inconsistent with the fundeps"?  And maybe be more precise about which fundep.

I'm a bit confused.

Simon

=====> Gentle(normal) 1182 of 3527 [0, 3, 0]
cd ./indexed-types/should_compile && 'C:/code/HEAD/bindisttest/install   dir/bin/ghc.exe' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -c Gentle.hs    >Gentle.comp.stderr 2>&1
Compile failed (status 256) errors were:

Gentle.hs:13:10:
    Illegal instance declaration for `Concrete a b'
      Multiple uses of this instance may be inconsistent
      with the functional dependencies of the class.
    In the instance declaration for `Concrete a b'

*** unexpected failure for Gentle(normal)

=====> T6068(ghci) 1852 of 3527 [0, 14, 0]
cd ./polykinds && HC='C:/code/HEAD/bindisttest/install   dir/bin/ghc.exe' HC_OPTS='-dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history ' 'C:/code/HEAD/bindisttest/install   dir/bin/ghc.exe' --interactive -v0 -ignore-dot-ghci -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history     <T6068.script >T6068.run.stdout 2>T6068.run.stderr
Actual stderr output differs from expected:
--- /dev/null          2013-01-14 17:04:32 +0000
+++ ./polykinds/T6068.run.stderr     2013-01-14 17:04:32 +0000
@@ -0,0 +1,9 @@
+
+T6068.hs:23:10:
+    Illegal instance declaration for `HasSingleton
+                                        (Maybe ak) (Maybe a) mp'
+      Multiple uses of this instance may be inconsistent
+      with the functional dependencies of the class.
+    In the instance declaration for `HasSingleton (Maybe a) mp'
+

=====> tc235(normal) 2812 of 3527 [0, 16, 0]
cd ./typecheck/should_compile && 'C:/code/HEAD/bindisttest/install   dir/bin/ghc.exe' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -c tc235.hs   -fno-warn-incomplete-patterns >tc235.comp.stderr 2>&1
Compile failed (status 256) errors were:

tc235.hs:24:10:
    Illegal instance declaration for `Gr g ep m'
      Multiple uses of this instance may be inconsistent
      with the functional dependencies of the class.
    In the instance declaration for `Gr g ep m'


=====> T5684(normal) 3185 of 3527 [0, 17, 0]
cd ./typecheck/should_fail && 'C:/code/HEAD/bindisttest/install   dir/bin/ghc.exe' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -c T5684.hs    >T5684.comp.stderr 2>&1
Actual stderr output differs from expected:
--- ./typecheck/should_fail/T5684.stderr     2013-01-14 13:42:13 +0000
+++ ./typecheck/should_fail/T5684.comp.stderr  2013-01-14 17:27:00 +0000
@@ -1,64 +1,6 @@
-T5684.hs:25:12:
-    No instance for (A b6) arising from a use of `op'
-    In the expression: op True undefined
-    In the expression:
-      [op False False, op 'c' undefined, op True undefined]
-    In an equation for `flop1':
-        flop1 = [op False False, op 'c' undefined, op True undefined]
-
-T5684.hs:30:12:
-    No instance for (A b5) arising from a use of `op'
-    In the expression: op True undefined
-    In the expression:
-      [op False False, op True undefined, op 'c' undefined]
-    In an equation for `flop2':
-        flop2 = [op False False, op True undefined, op 'c' undefined]
-
-T5684.hs:36:12:
-    No instance for (A b4) arising from a use of `op'
-    In the expression: op True undefined
-    In the expression:
-      [op 'c' undefined, op True undefined, op False False]
-    In an equation for `flop3':
-        flop3 = [op 'c' undefined, op True undefined, op False False]
-
-T5684.hs:42:12:
-    No instance for (A b3) arising from a use of `op'
-    In the expression: op True undefined
-    In the expression:
-      [op 'c' undefined, op False False, op True undefined]
-    In an equation for `flop4':
-        flop4 = [op 'c' undefined, op False False, op True undefined]
-
-T5684.hs:46:12:
-    No instance for (A b2) arising from a use of `op'
-    In the expression: op True undefined
-    In the expression:
-      [op True undefined, op 'c' undefined, op False False]
-    In an equation for `flop5':
-        flop5 = [op True undefined, op 'c' undefined, op False False]
-
-T5684.hs:52:12:
-    No instance for (A b0) arising from a use of `op'
-    In the expression: op True undefined
-    In the expression:
-      [op True undefined, op False False, op 'c' undefined]
-    In an equation for `flop6':
-        flop6 = [op True undefined, op False False, op 'c' undefined]
-
-T5684.hs:53:12:
-    No instance for (A Bool) arising from a use of `op'
-    In the expression: op False False
-    In the expression:
-      [op True undefined, op False False, op 'c' undefined]
-    In an equation for `flop6':
-        flop6 = [op True undefined, op False False, op 'c' undefined]
-
-T5684.hs:54:12:
-    No instance for (B Char b1) arising from a use of `op'
-    In the expression: op 'c' undefined
-    In the expression:
-      [op True undefined, op False False, op 'c' undefined]
-    In an equation for `flop6':
-        flop6 = [op True undefined, op False False, op 'c' undefined]
+T5684.hs:10:10:
+    Illegal instance declaration for `B Bool b'
+      Multiple uses of this instance may be inconsistent
+      with the functional dependencies of the class.
+    In the instance declaration for `B Bool b'
*** unexpected failure for T5684(normal)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130114/fa4de511/attachment-0001.htm>

Reply | Threaded
Open this post in threaded view
|

Failing test

Iavor Diatchki
Hello,


On Mon, Jan 14, 2013 at 9:52 AM, Simon Peyton-Jones
<simonpj at microsoft.com>wrote:

>
> Are these four failures the result of your changes?****
>
> Should we fix the tests?
>

(sorry, this went to the fun-dep thread so it probably got buried among the
other e-mails).

About the tests: When I ran the type-checker tests, I got these 3 failures
that I am not sure how to fix:

Unexpected failures:
   should_compile  tc226 [exit code non-0] (hpc,optasm)
   should_compile  tc235 [exit code non-0] (normal,hpc,optasm)
   should_fail     T5684 [stderr mismatch] (normal)

- tc226 appears to be completely unrelated to my changes, so I imagine it
is about something else?
- tc235 is a program that is now rejected.  I am not sure how to fix this
test as the program inside seems incorrect at many levels (e.g., it
violates the FD of the class, but it also uses ambiguous methods).  I also
couldn't figure out what it is testing.
- T5684 is still rejected but with a different error, because one of the
instances violates the FD of the class.   However, this test appears to be
carefully designed to test something else, but I didn't quite follow
exactly what, so I left it as is for the moment.

Would you mind taking a look and advising on what to do?  I think that the
new behavior is correct for tc235 and T5684, but it would be nice to
preserve whatever was originally tasted there (unless it was an artifact of
the lax checking of the FDs)



> **
>
> Should the error message say ?The instance decl is inconsistent with the
> fundeps??  And maybe be more precise about which fundep.****
>
> **
>
We could do that.  The current message replaces "the Coverage Condition
fails for one of the functional dependencies", because I thought that it is
more descriptive.   The way the tests is written---both the coverage
condition, and the new one---they return just a boolean, but I could
probably to return the FD that is being violated.  I'll have a go at it.



> I?m a bit confused.
>
About which part?   Here is an example of what we are checking for:

class C a b | a -> b
instance C Int b -- bad instance

The instance violated the FD on the class because it implies that both `C
Int Int` and `C Int Char` hold, which violated the FD.  This is what I
meant by "multiple uses of the instance may violate the functional
dependency".  The reason I opted to go for "may" in the message is because
strictly speaking the test is incomplete (i.e., there are somewhat
contrived examples that are consistent with the FD, but would be rejected,
I can send one if it'd be useful?).

-Iavor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130114/6fde4e94/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

Failing test

Simon Peyton Jones
OK i?ve fixed these.  will push when I have valiated

From: Iavor Diatchki [mailto:iavor.diatchki at gmail.com]
Sent: 14 January 2013 18:40
To: Simon Peyton-Jones
Cc: ghc-devs at haskell.org
Subject: Re: Failing test

Hello,


On Mon, Jan 14, 2013 at 9:52 AM, Simon Peyton-Jones <simonpj at microsoft.com<mailto:simonpj at microsoft.com>> wrote:
Are these four failures the result of your changes?
Should we fix the tests?

(sorry, this went to the fun-dep thread so it probably got buried among the other e-mails).

About the tests: When I ran the type-checker tests, I got these 3 failures that I am not sure how to fix:

Unexpected failures:
   should_compile  tc226 [exit code non-0] (hpc,optasm)
   should_compile  tc235 [exit code non-0] (normal,hpc,optasm)
   should_fail     T5684 [stderr mismatch] (normal)

- tc226 appears to be completely unrelated to my changes, so I imagine it is about something else?
- tc235 is a program that is now rejected.  I am not sure how to fix this test as the program inside seems incorrect at many levels (e.g., it violates the FD of the class, but it also uses ambiguous methods).  I also couldn't figure out what it is testing.
- T5684 is still rejected but with a different error, because one of the instances violates the FD of the class.   However, this test appears to be carefully designed to test something else, but I didn't quite follow exactly what, so I left it as is for the moment.

Would you mind taking a look and advising on what to do?  I think that the new behavior is correct for tc235 and T5684, but it would be nice to preserve whatever was originally tasted there (unless it was an artifact of the lax checking of the FDs)


Should the error message say ?The instance decl is inconsistent with the fundeps??  And maybe be more precise about which fundep.
We could do that.  The current message replaces "the Coverage Condition fails for one of the functional dependencies", because I thought that it is more descriptive.   The way the tests is written---both the coverage condition, and the new one---they return just a boolean, but I could probably to return the FD that is being violated.  I'll have a go at it.


I?m a bit confused.
About which part?   Here is an example of what we are checking for:

class C a b | a -> b
instance C Int b -- bad instance

The instance violated the FD on the class because it implies that both `C Int Int` and `C Int Char` hold, which violated the FD.  This is what I meant by "multiple uses of the instance may violate the functional dependency".  The reason I opted to go for "may" in the message is because strictly speaking the test is incomplete (i.e., there are somewhat contrived examples that are consistent with the FD, but would be rejected, I can send one if it'd be useful?).

-Iavor


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130115/537a000a/attachment-0001.htm>