eclipse-qvtd / org.eclipse.qvtd

Eclipse Public License 2.0
0 stars 0 forks source link

[scheduler] New scheduler fails with enhanced Example2 #147

Closed eclipse-qvtd-bot closed 17 hours ago

eclipse-qvtd-bot commented 17 hours ago

| --- | --- | | Bugzilla Link | 485165 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Jan 04, 2016 11:58 EDT | | Modified | Jan 12, 2016 09:49 EDT | | Reporter | Adolfo Sanchez-Barbudo Herrera |

Description

Whereas flat scheduler is able to successfully execute a test cases related to the enhanced example 2 [1], the new scheduler struggles with it.

Branch with the new test case coming next.

[1] testExample2_V2_Interpreted and testExample2_V2_CG

eclipse-qvtd-bot commented 17 hours ago

By Adolfo Sanchez-Barbudo Herrera on Jan 04, 2016 12:06

Branches:\ OCL -> I201601021212\ QVTd -> asanchez/485165

Step to reproduce:

org.eclipse.qvtd.compiler.internal.scheduler.DependencyAnalyzer$BlockedAnalysisException\ at org.eclipse.qvtd.compiler.internal.scheduler.DependencyAnalyzer.executeOperationCall(DependencyAnalyzer.java:1027)\ at org.eclipse.qvtd.compiler.internal.scheduler.DependencyAnalyzer$DependencyAnalyzerVisitor.visitOperationCallExp(DependencyAnalyzer.java:552)\ at org.eclipse.qvtd.compiler.internal.scheduler.DependencyAnalyzer$DependencyAnalyzerVisitor.visitOperationCallExp(DependencyAnalyzer.java:1)\ at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:461)\ at org.eclipse.qvtd.compiler.internal.scheduler.DependencyAnalyzer$DependencyAnalyzerVisitor.analyze(DependencyAnalyzer.java:447)\ at org.eclipse.qvtd.compiler.internal.scheduler.DependencyAnalyzer.analyze(DependencyAnalyzer.java:865)\ at org.eclipse.qvtd.compiler.internal.scheduler.DependencyAnalyzer.analyze(DependencyAnalyzer.java:799)\ at org.eclipse.qvtd.compiler.internal.scheduler.OperationRegion.(OperationRegion.java:77)\ at org.eclipse.qvtd.compiler.internal.scheduler.Scheduler.analyzeOperation(Scheduler.java:86)\ at org.eclipse.qvtd.compiler.internal.scheduler.SuperRegion.analyzeOperation(SuperRegion.java:43)\ at org.eclipse.qvtd.compiler.internal.scheduler.ExpressionAnalyzer.visitOperationCallExp(ExpressionAnalyzer.java:488)\ at org.eclipse.qvtd.compiler.internal.scheduler.ExpressionAnalyzer.visitOperationCallExp(ExpressionAnalyzer.java:1)\ at org.eclipse.ocl.pivot.internal.OperationCallExpImpl.accept(OperationCallExpImpl.java:461)\ at org.eclipse.qvtd.compiler.internal.scheduler.ExpressionAnalyzer.analyze(ExpressionAnalyzer.java:83)\ at org.eclipse.qvtd.compiler.internal.scheduler.MappingRegion.(MappingRegion.java:133)\ at org.eclipse.qvtd.compiler.internal.scheduler.Scheduler.createSuperRegions(Scheduler.java:176)\ at org.eclipse.qvtd.compiler.internal.scheduler.Scheduler.qvtp2qvts(Scheduler.java:331)\ at org.eclipse.qvtd.compiler.internal.etl.MtcBroker.qvtp2qvti(MtcBroker.java:476)\ at org.eclipse.qvtd.cs2as.compiler.internal.OCL2QVTiBroker.newExecute(OCL2QVTiBroker.java:140)\ at org.eclipse.qvtd.cs2as.compiler.tests.OCL2QVTiTestCases.executeNewOCL2QVTi_MTC(OCL2QVTiTestCases.java:708)\ at org.eclipse.qvtd.cs2as.compiler.tests.OCL2QVTiTestCases.testNewExample2_V2_Interpreted(OCL2QVTiTestCases.java:308)\ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\ at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\ at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\ at java.lang.reflect.Method.invoke(Method.java:497)\ at junit.framework.TestCase.runTest(TestCase.java:176)\ at junit.framework.TestCase.runBare(TestCase.java:141)\ at junit.framework.TestResult$1.protect(TestResult.java:122)\ at junit.framework.TestResult.runProtected(TestResult.java:142)\ at junit.framework.TestResult.run(TestResult.java:125)\ at junit.framework.TestCase.run(TestCase.java:129)\ at junit.framework.TestSuite.runTest(TestSuite.java:252)\ at junit.framework.TestSuite.run(TestSuite.java:247)\ at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)\ at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)\ at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)\ at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)\ at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)\ at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)\ at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

eclipse-qvtd-bot commented 17 hours ago

By Ed Willink on Jan 07, 2016 17:42

BlockedAnalysisException is used to break dependency loops in the Operation dependency analysis.

It is occurring in

def : isOpCallExp() : Boolean =\ roundedBrackets <> null

which is almost trivial. Should be an easy fix.

eclipse-qvtd-bot commented 17 hours ago

By Ed Willink on Jan 11, 2016 13:24

(In reply to Ed Willink from comment #2)

It is occurring in

def : isOpCallExp() : Boolean = roundedBrackets <> null

Actually it occurs in not() which is nested invocation that fails to catch the BlockedAnalysisException.

Useful test example. Many other problems diagnosed and fixed.


Initial fix proved a bit indeterminate. Problem was that a PropertyCallExp's domain usage was that of the property type not owning class. This resulted in double usage for classes and consequently an opportunity for random wrong choice.

This was fixed and failures are much rarer, but seemingly not yet solid.

The log shows failure is again an empty output from:

org.eclipse.qvtd.compiler/qvtp2qvts/dump/property2consumingClass :

eclipse-qvtd-bot commented 17 hours ago

By Ed Willink on Jan 12, 2016 04:37

(In reply to Ed Willink from comment #3)

This was fixed and failures are much rarer, but seemingly not yet solid.

The log shows failure is again an empty output from:

org.eclipse.qvtd.compiler/qvtp2qvts/dump/property2consumingClass :

Separate Bug 485616 for this residual issue.

eclipse-qvtd-bot commented 17 hours ago

By Adolfo Sanchez-Barbudo Herrera on Jan 12, 2016 07:53

Hi Ed,

Well done. Thanks.

asanchez/486165 has incorporated an additional example, which makes the transformation execution throw an NPE.

After debugging, it seems and scheduler issue. Briefly:

We have a slightly more complicated "prop1.name" property call exp. In order to do the "name" property lookup for the nested PropertyCallExp, the outer prop1 PropertyCallExp type needs to be previously computed. However, it's null.

The description seems fine. At least, prop1 PropertyCallExp type is properly computed in the example you just fixed.

[NB Don't get confused by the Classescs2as example, since it has some differences with respect to OCL. For instance, as opposite to what happens in OCL, in the example, the containmient hierarchy of nested CallExp elements in the AS aligns with the containment hierarchy of NameExpCS elements in the CS. In other words, the source of a CallExp is its parent rather than its children]

eclipse-qvtd-bot commented 17 hours ago

By Ed Willink on Jan 12, 2016 09:20

Fixes prior to last comment pushed to master for M5.

eclipse-qvtd-bot commented 17 hours ago

By Ed Willink on Jan 12, 2016 09:49

(In reply to Adolfo Sanchez-Barbudo Herrera from comment #5)

asanchez/486165 has incorporated an additional example, which makes the transformation execution throw an NPE.

Move to Bug 485664