verivital / hyst

HyST: A Source Transformation and Translation Tool for Hybrid Automaton Models
http://verivital.com/hyst/
Other
15 stars 18 forks source link

Xspeed printer added #12

Closed rajray84 closed 5 years ago

stanleybak commented 8 years ago

Some comments to address:

SpaceExXMLPrinter.java:

SpaceExXMLReader.java:

Bind.java:

Lots of other files seem to revert changes in master. Rather than going through each one I suggest we first figure out what happened with the bad merge. It was probably some update to master after you forked. Hope that makes sense; let me know if you have questions.

rajray84 commented 8 years ago

Thanks for the comments, Let us look into it and get back to you.

On Thu, Dec 3, 2015 at 2:36 AM, Stanley Bak notifications@github.com wrote:

Some comments to address:

  • XspeedPrinterTest.java seems generalized for many printers (there is an arraylist of printers), but only a single printer is ever used. Remove this unnecessary generalization and just directly use XspeedPrinter.
  • makeSampleConfiguration is an unused function, remove it.
  • please move the tests from tests/unit/XspeedModel/ to tests/unit/models/

SpaceExXMLPrinter.java:

  • There seem to be changes here that revert previous things (probably a bad merge). Justify or remove these changes (for example, why is the the line removed: paramElem.setAttribute("controlled", "false");??)

SpaceExXMLReader.java:

  • same, there seem to be some reversions here which shouldn't be in the pull

Bind.java:

  • same, there are reversions here

Lots of other files seem to revert changes in master. Rather than going through each one I suggest we first figure out what happened with the bad merge. It was probably some update to master after you forked. Hope that makes sense; let me know if you have questions.

— Reply to this email directly or view it on GitHub https://github.com/verivital/hyst/pull/12#issuecomment-161434009.

ttj commented 8 years ago

Just did upstream merge, once we finish the pull request for order reduction I will upstream merge again to get all the latest changes to the main line (as that is going to add hybridization stuff, etc. too due to backout).

This currently has a compile error related to spaceex options that I think will get resolved when we do the upstream merge after the order reduction pull is completed.

ttj commented 8 years ago

Stan and Rajarshi:

I just did the upstream merge. I still cannot seem to build due to some remaining errors in the hybridization pass, spaceex printer, and location (missing import for hyst.ir.base.Interval, seems to have been changed to ExpressionInterval, at least in Luan's branch which is up-to-date with master?).

Stan: could you please pull and help me to merge this, as I'm not 100% sure the latest status of some of these files versus what I'm seeing in Rajarshi's fork that is causing the build errors, and perhaps we will need to query Rajarshi as well?

rajray84 commented 8 years ago

Thanks Taylor for merging XSpeed printer with the main branch. Let me know in case you see errors due to my fork.

Regards, Rajarshi

On Tue, Dec 15, 2015 at 9:01 AM, Taylor Johnson notifications@github.com wrote:

Stan and Rajarshi:

I just did the upstream merge. I still cannot seem to build due to some remaining errors in the hybridization pass, spaceex printer, and location (missing import for hyst.ir.base.Interval, seems to have been changed to ExpressionInterval, at least in Luan's branch which is up-to-date with master?).

Stan: could you please pull and help me to merge this, as I'm not 100% sure the latest status of some of these files versus what I'm seeing in Rajarshi's fork that is causing the build errors, and perhaps we will need to query Rajarshi as well?

— Reply to this email directly or view it on GitHub https://github.com/verivital/hyst/pull/12#issuecomment-164634174.

ttj commented 8 years ago

I'm reverting those three files to the previous versions where some additions seem to have been lost in Rajarshi's version:

java\de\uni_freiburg\informatik\swt\sxhybridautomaton Location.java SpaceExDocument.java SpaceExConfigValues.java

This allows it to build at least.

Stan: can you please sanity check for me when you have a chance (e.g., make sure no other changes lost)? I reverted these just by comparing to previous versions and taking the prior versions.

Some PrinterTests are failing now. I will try to look at later today if Stan doesn't get to it first:

       [junit] Testcase: testDisjunctiveGuard took 0.033 sec
       [junit]  Caused an ERROR
       [junit] XSpeed does not work on Disjunctiveguard models
       [junit] java.lang.RuntimeException: XSpeed does not work on Disjunctiveguard models
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.getguardConditionExpressionRecXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.getguardConditionExpressionXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
       [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnConfiguration(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.testDisjunctiveGuard(Unknown Source)
       [junit] Testcase: testPrintUrgent took 0.058 sec
       [junit]  Caused an ERROR
       [junit] printer did not print successfully the model (all precondition checks rejected it): urgent_composition.xml
       [junit] java.lang.RuntimeException: printer did not print successfully the model (all precondition checks rejected it): urgent_composition.xml
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintUrgent(Unknown Source)
       [junit] Testcase: testPrintIntervalExpression took 0.022 sec
       [junit]  Caused an ERROR
       [junit] XSpeed does not work on non-deterministic models
       [junit] java.lang.RuntimeException: XSpeed does not work on non-deterministic models
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.TransIdXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
       [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnConfiguration(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintIntervalExpression(Unknown Source)
       [junit] Testcase: testPrintHavocTransitionFlows took 0.133 sec
       [junit]  Caused an ERROR
       [junit] XSpeed does not work on non-deterministic models
       [junit] java.lang.RuntimeException: XSpeed does not work on non-deterministic models
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.TransIdXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
       [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintHavocTransitionFlows(Unknown Source)
       [junit] Testcase: testPrintUrgentSimple took 0.083 sec
       [junit]  Caused an ERROR
       [junit] printer did not print successfully the model (all precondition checks rejected it): urgent_simple.xml
       [junit] java.lang.RuntimeException: printer did not print successfully the model (all precondition checks rejected it): urgent_simple.xml
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintUrgentSimple(Unknown Source)
       [junit] Testcase: testPrintSimpleModel took 0.201 sec
       [junit]  Caused an ERROR
       [junit] XSpeed does not work on non-deterministic models
       [junit] java.lang.RuntimeException: XSpeed does not work on non-deterministic models
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.TransIdXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
       [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintSimpleModel(Unknown Source)
       [junit] Testcase: testPrintNondeterministicAssignments took 0.083 sec
       [junit]  Caused an ERROR
       [junit] XSpeed does not work on non-deterministic models
       [junit] java.lang.RuntimeException: XSpeed does not work on non-deterministic models
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.TransIdXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
       [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
       [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
       [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintNondeterministicAssignments(Unknown Source)

BUILD FAILED
D:\Dropbox\Research\verivital_repos\hyst-xspeed\src\build.xml:169: Test com.verivital.hyst.junit.PrintersTest failed
stanleybak commented 8 years ago

Hey sorry I've been sick the last few days. I'll take a look at it tomorrow.

-Stan

On Tue, Dec 15, 2015 at 12:50 PM, Taylor Johnson notifications@github.com wrote:

I'm reverting those three files to the previous versions where some additions seem to have been lost in Rajarshi's version:

java\de\uni_freiburg\informatik\swt\sxhybridautomaton Location.java SpaceExDocument.java SpaceExConfigValues.java

This allows it to build at least.

Stan: can you please sanity check for me when you have a chance (e.g., make sure no other changes lost)? I reverted these just by comparing to previous versions and taking the prior versions.

Some PrinterTests are failing now. I will try to look at later today if Stan doesn't get to it first:

   [junit] Testcase: testDisjunctiveGuard took 0.033 sec
   [junit]  Caused an ERROR
   [junit] XSpeed does not work on Disjunctiveguard models
   [junit] java.lang.RuntimeException: XSpeed does not work on Disjunctiveguard models
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.getguardConditionExpressionRecXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.getguardConditionExpressionXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
   [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnConfiguration(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.testDisjunctiveGuard(Unknown Source)
   [junit] Testcase: testPrintUrgent took 0.058 sec
   [junit]  Caused an ERROR
   [junit] printer did not print successfully the model (all precondition checks rejected it): urgent_composition.xml
   [junit] java.lang.RuntimeException: printer did not print successfully the model (all precondition checks rejected it): urgent_composition.xml
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintUrgent(Unknown Source)
   [junit] Testcase: testPrintIntervalExpression took 0.022 sec
   [junit]  Caused an ERROR
   [junit] XSpeed does not work on non-deterministic models
   [junit] java.lang.RuntimeException: XSpeed does not work on non-deterministic models
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.TransIdXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
   [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnConfiguration(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintIntervalExpression(Unknown Source)
   [junit] Testcase: testPrintHavocTransitionFlows took 0.133 sec
   [junit]  Caused an ERROR
   [junit] XSpeed does not work on non-deterministic models
   [junit] java.lang.RuntimeException: XSpeed does not work on non-deterministic models
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.TransIdXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
   [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintHavocTransitionFlows(Unknown Source)
   [junit] Testcase: testPrintUrgentSimple took 0.083 sec
   [junit]  Caused an ERROR
   [junit] printer did not print successfully the model (all precondition checks rejected it): urgent_simple.xml
   [junit] java.lang.RuntimeException: printer did not print successfully the model (all precondition checks rejected it): urgent_simple.xml
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintUrgentSimple(Unknown Source)
   [junit] Testcase: testPrintSimpleModel took 0.201 sec
   [junit]  Caused an ERROR
   [junit] XSpeed does not work on non-deterministic models
   [junit] java.lang.RuntimeException: XSpeed does not work on non-deterministic models
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.TransIdXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
   [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintSimpleModel(Unknown Source)
   [junit] Testcase: testPrintNondeterministicAssignments took 0.083 sec
   [junit]  Caused an ERROR
   [junit] XSpeed does not work on non-deterministic models
   [junit] java.lang.RuntimeException: XSpeed does not work on non-deterministic models
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.TransIdXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printJumpsXspeed(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printProcedure(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printDocument(Unknown Source)
   [junit]  at com.verivital.hyst.printers.XspeedPrinter.printAutomaton(Unknown Source)
   [junit]  at com.verivital.hyst.printers.ToolPrinter.print(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.runAllPrintersOnModel(Unknown Source)
   [junit]  at com.verivital.hyst.junit.PrintersTest.testPrintNondeterministicAssignments(Unknown Source)

BUILD FAILED D:\Dropbox\Research\verivital_repos\hyst-xspeed\src\build.xml:169: Test com.verivital.hyst.junit.PrintersTest failed

— Reply to this email directly or view it on GitHub https://github.com/verivital/hyst/pull/12#issuecomment-164838137.

stanleybak commented 8 years ago

Interval is a pair of numbers (lower bound and upper bound), whereas an ExpressionInteval is a container object consisting of an Expression as well as an Interval (these are used to represent possibly nondeterministic flows). The Interval class was moved from the com.verivital.hyst.ir.base package to the com.verivital.hyst.geometry package.

stanleybak commented 8 years ago

When an exception is caught and reraised, it is useful to pass the original exception into the new one being raised, so that a full code trace is available to see where the problem is occuring. For example, if you catch an Exception e, you can re-raise it by doing throw new Exception("problem occured", e); and it will preserve the trace.

For example, in PrintersTest.testDisjunctiveGuard(), the message: "XSpeed does not work on Disjunctiveguard models". This comes from around line 1022 in the XSpeedPrinter, which occurs whenever a general Exception occurs. It is bad to catch general exceptions if possible, except maybe at the highest level of the program. Be more specific with the exceptions that can occur and are being caught. In this case, for example, the exception is caused by an ArrayOutOfBoundsException at the following line: guardY[invindex][l] = -1;. I don't know why an ArrayOutOfBOundsException is occurring.

In this case, I think what's happening is that there are two transitions from, say, mode A to mode B, but neither of the guards contains an 'or' expression (it gets converted before the printer sees it, anyway). Is this considered a disjunctive guard in the printer that can't be handled? Does this mean that general transition graphs are not allowed since there can be at most one transition between any two modes? (It's okay if this is the case, I just want to make sure I understand what is happening).

testPrintUrgent() was failing. The cause was that there was a bad merge before (I think I had mentioned it earlier): https://github.com/rajray84/hyst/commit/991cf5d2d1aaa54fd21825b3d152eb4678b5b93e This is why Taylor needed to revert some of the files to get it to compile. In this bad merge the following line was added into PrintersTests.java: throw new RuntimeException("printer did not print successfully the model (all precondition checks rejected it): " + xmlName);, which was called when ANY printer rejected the model (rather than all of them).

The test testPrintUrgent() still fails, now saying that "XSpeed does not work on non-deterministic models" (from around line 2208). What is meant by non-deterministic here? The guards? The initial state? The flows? This type of condition checking should be done using Preconditions, and we may have the code written to do it, but it's not clear what type of nondeterminism is being referred to.

In the XSpeedPrinter constructor there is the code:

public XspeedPrinter() {
    preconditions.skip[PreconditionsFlag.NO_URGENT.ordinal()] = true;
    preconditions.skip[PreconditionsFlag.NO_NONDETERMINISTIC_DYNAMICS
            .ordinal()] = true;
    preconditions.skip[PreconditionsFlag.CONVERT_NONDETERMINISTIC_RESETS
            .ordinal()] = true;
}

This indicates that the printer can handle nondeterministic dynamics, urgent transitions, and nondeterministic resets. However, as the failing unit tests indicate, it cannot handle these features (they raise exceptions). The solution is to not indicate that they can be handled in the constructor (I have done this).

More tests are passed; there are still exceptions being raised for nondeterminism, but it's not clear what type of nondeterminism is not supported. Please look into these (print out the specific problems in the errors being raised) and post comments as to what the problem is and why we can discuss the best way to handle it (for example, look into why testPrintSimpleModel() is raising an exception).

There are some other logic problems, for example:

if(eee instanceof Operation)
{
   eee = simplifyExpression(eee);
   Operation o = (Operation) eee;

after simplifyExpression() eee may no longer be an Operation (it might be a Variable, for instance), so this cases a ClassCastException in testPrintNondeterministicAssignments()

Use the new Classification.isLinearDynamics(mode.flowDynamics) rather than your own public static boolean isLinearExpression() (which was copied from FlowPrinter). In general, code shouldn't be copied and pasted as this makes it difficult to maintain (instead of fixing bugs or making changes in one place, now there have to be changes in multiple places, and it's not tracked where multiple places are, which is inviting omissions).

On large projects, code quality is especially important. Think about if someone wants to modify the printer after you've moved on to another project. This is especially true for code going into the release version of Hyst, which should have higher quality than something quickly put together as a proof of concept.

There shouldn't be things like:

ttj commented 8 years ago

Hi Stan,

Thanks very much!

Could you please perhaps pull out some of these points into the developer readme or style guidelines?

I think it's going to be important to have such a guide to point people at for adding new printers, etc.

Rajarshi: sorry this is taking a while, but you have been our guinea pig as you're the first person to add a new printer outside our group. Thanks very much for all your help and patience as we navigate the process for the first time!

rajray84 commented 8 years ago

Hi Stan and Taylor,

Thank you very much for the helpful comments. This is also the first time we are trying to contribute to any open-source project. We will go through each and every comment of Stan and try to take them into account.

Regards, Rajarshi

On Fri, Dec 18, 2015 at 2:27 AM, Taylor Johnson notifications@github.com wrote:

Hi Stan,

Thanks very much!

Could you please perhaps pull out some of these points into the developer readme or style guidelines?

I think it's going to be important to have such a guide to point people at for adding new printers, etc.

Rajarshi: sorry this is taking a while, but you have been our guinea pig as you're the first person to add a new printer outside our group. Thanks very much for all your help and patience as we navigate the process for the first time!

— Reply to this email directly or view it on GitHub https://github.com/verivital/hyst/pull/12#issuecomment-165580122.

ttj commented 8 years ago

hi all,

I'd like to try to get this merged in soonish, so I just did an upstream pull for the xspeed fork. Unfortunately a bunch of unit tests seem to fail now, related to Python. This may likely be related to Stan's latest LUT changes (sorry, did not have time to review yesterday), so I wanted to check (and also in my fork I just checked and these errors do seem to be happening with the latest upstream merged in).

[junit] Testcase: testLinearInterpolation1d took 0.002 sec [junit] Caused an ERROR [junit] pythonSimplifyExpression called, but python was not enabled [junit] com.verivital.hyst.ir.AutomatonExportException: pythonSimplifyExpression called, but python was not enabled [junit] at com.verivital.hyst.python.PythonUtil.pythonSimplifyExpression(Unknown Source) [junit] at com.verivital.hyst.python.PythonUtil.pythonSimplifyExpressionChop(Unknown Source) [junit] at com.verivital.hyst.passes.complex.ConvertLutFlowsPass.nLinearInterpolation(Unknown Source) [junit] at com.verivital.hyst.junit.LutMatrixTest.testLinearInterpolation1d(Unknown Source) [junit] Testcase: testLinearInterpolation2d took 0.003 sec

stanleybak commented 8 years ago

This is releated to the repeatability of tests. We currently have two ways to simplify expressions, a built-in method, and a python approach which uses smypy. Before, we would have simplification use python, only if it exists. Then, some tests would have different results depending on if python was installed or not, which isn't good. I made the call to the simplification engine explicit now. The downside is, if you use the sympy one, it fails if you don't have python.

I think the way to solve this would be to make the simplficiation engine explicit in the code, and use no simplification in the unit tests, unless an explicit test for python was done. I'll look at it tomorrow.

stanleybak commented 5 years ago

closing this as it's old. If we want to merge this printer, please make a new pull request from the latest version