Scala Programming Language
  1. Scala Programming Language
  2. SI-7020

Non-deterministic warnings from virtpatmat

    Details

      Description

      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 SI-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

        Hide
        Jason Zaugg added a comment -

        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.

        Show
        Jason Zaugg added a comment - 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.
        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/2826
        Hide
        Jason Zaugg added a comment -

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

        Show
        Jason Zaugg added a comment - Raising to critical, non determinism is the enemy of regression testing, and this one came up in @gbasler's recent pattern matcher rework.
        Hide
        Adriaan Moors added a comment -

        Awesome – thanks!

        Show
        Adriaan Moors added a comment - Awesome – thanks!
        Hide
        Adriaan Moors added a comment -

        It didn't fix the tseitin refactor. Looking into that now.

        Show
        Adriaan Moors added a comment - It didn't fix the tseitin refactor. Looking into that now.
        Hide
        Jason Zaugg added a comment -

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

        Show
        Jason Zaugg added a comment - Reopening: The non-determinism monster remains at large: https://github.com/scala/scala/pull/3043/files
        Hide
        Jason Zaugg added a comment -

        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
        
        Show
        Jason Zaugg added a comment - 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
        Hide
        Jason Zaugg added a comment -

        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.

        Show
        Jason Zaugg added a comment - 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.
        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/3068

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Szabolcs Berecz
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development