Skip to content

Non-deterministic warnings from virtpatmat #7020

Closed

Description

@scabug

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

Activity

  1. scabug commented on Jan 25, 2013

    @scabug
    Author

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

  2. scabug commented on Aug 11, 2013

    @scabug
    Author

    @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.

  3. scabug commented on Aug 13, 2013

    @scabug
    Author
  4. scabug commented on Aug 13, 2013

    @scabug
    Author

    @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.

  5. scabug commented on Aug 13, 2013

    @scabug
    Author

    @adriaanm said:
    Awesome -- thanks!

  6. scabug commented on Aug 13, 2013

    @scabug
    Author

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

  7. scabug commented on Oct 17, 2013

    @scabug
    Author

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

  8. scabug commented on Oct 21, 2013

    @scabug
    Author

    @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
    
  9. scabug commented on Oct 21, 2013

    @scabug
    Author

    @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.

  10. scabug commented on Oct 21, 2013

    @scabug
    Author
  11. added this to the 2.11.0-M7 milestone on Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions