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

Non-deterministic warnings from virtpatmat #7020

Closed
scabug opened this issue Jan 25, 2013 · 10 comments
Closed

Non-deterministic warnings from virtpatmat #7020

scabug opened this issue Jan 25, 2013 · 10 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jan 25, 2013

Compiling the following three tests generate different output on each run:

test/files/run/virtpatmat_alts.scala
test/files/run/virtpatmat_nested_lists.scala
test/files/run/virtpatmat_opt_sharing.scala

Currently, partest doesn't see these warnings because of #7003, so the tests pass.

An example:

szabi@kama3 ~/dev/git/scala > qscalac test/files/run/virtpatmat_alts.scala
test/files/run/virtpatmat_alts.scala:2: warning: match may not be exhaustive.
It would fail on the following inputs: (false, true), (true, false)
  (true, true) match {
  ^
test/files/run/virtpatmat_alts.scala:6: warning: match may not be exhaustive.
It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List((x: Int forSome x not in (1, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _)
  List(5) match {
      ^
two warnings found

szabi@kama3 ~/dev/git/scala > qscalac test/files/run/virtpatmat_alts.scala
test/files/run/virtpatmat_alts.scala:2: warning: match may not be exhaustive.
It would fail on the following inputs: (false, true), (true, false)
  (true, true) match {
  ^
test/files/run/virtpatmat_alts.scala:6: warning: match may not be exhaustive.
It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List((x: Int forSome x not in (1, 2, 4, 5, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _)
  List(5) match {
      ^
two warnings found
@scabug
Copy link
Author

@scabug scabug commented Jan 25, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7020?orig=1
Reporter: @khernyo
Affected Versions: 2.10.0

@scabug
Copy link
Author

@scabug scabug commented Aug 11, 2013

@retronym said:
This seems to return us to the realm of determinism: https://github.com/retronym/scala/compare/ticket/7020

I still need to add the other tests and also figure out which of those sets/maps actually needs to be linked rather than the heavy handed approach I took.

@scabug
Copy link
Author

@scabug scabug commented Aug 13, 2013

@scabug
Copy link
Author

@scabug scabug commented Aug 13, 2013

@retronym said:
Raising to critical, non determinism is the enemy of regression testing, and this one came up in @gbasler's recent pattern matcher rework.

@scabug
Copy link
Author

@scabug scabug commented Aug 13, 2013

@adriaanm said:
Awesome -- thanks!

@scabug
Copy link
Author

@scabug scabug commented Aug 13, 2013

@adriaanm said:
It didn't fix the tseitin refactor. Looking into that now.

@scabug
Copy link
Author

@scabug scabug commented Oct 17, 2013

@retronym said:
Reopening: The non-determinism monster remains at large: https://github.com/scala/scala/pull/3043/files

@scabug
Copy link
Author

@scabug scabug commented Oct 21, 2013

@retronym said:
I could reproduce the error:

# Generate some clones of the test
% for i in {1..100}; do cp test/disabled/neg/t7020.scala test/disabled/neg/t7020-$i.scala; cp test/disabled/neg/t7020.flags test/disabled/neg/t7020-$i.flags; cat test/disabled/neg/t7020.check | sed "s/t7020/t7020-$i/" > test/disabled/neg/t7020-$i.check; done

/code/scala test/partest --terse --srcpath disabled test/disabled/neg/t7020*.scala
Selected 101 tests drawn from specified tests

# starting 101 tests in neg
........................................................................
.............................

101/101 passed (elapsed time: 00:00:34)
Test Run PASSED
ticket/7020-2 /code/scala test/partest --terse --srcpath disabled test/disabled/neg/t7020*.scala
Selected 101 tests drawn from specified tests

# starting 101 tests in neg
........................................................................
.............................

101/101 passed (elapsed time: 00:00:34)
Test Run PASSED
ticket/7020-2 /code/scala test/partest --terse --srcpath disabled test/disabled/neg/t7020*.scala
Selected 101 tests drawn from specified tests

# starting 101 tests in neg
........................................................................
.............................

101/101 passed (elapsed time: 00:00:34)
Test Run PASSED
ticket/7020-2 /code/scala test/partest --terse --srcpath disabled test/disabled/neg/t7020*.scala
Selected 101 tests drawn from specified tests

# starting 101 tests in neg
........................................................................
..
!!   1 - neg/t7020-76.scala                        [output differs]
..........................
# 100/101 passed, 1 failed in neg

# Failed test paths (this command will update checkfiles)
test/partest --update-check \
  /Users/jason/code/scala/test/disabled/neg/t7020-76.scala

100/101 passed, 1 failed (elapsed time: 00:00:32)
Test Run FAILED

@scabug
Copy link
Author

@scabug scabug commented Oct 21, 2013

@retronym said:
This fixes the non-determinism: https://github.com/retronym/scala/compare/ticket/7020-3

I'm still trying to figure out which parts of the patch actually fix the problem.

@scabug
Copy link
Author

@scabug scabug commented Oct 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants