viperproject/silicon

External parallelization of Silicon

pieter-bos opened this issue · 5 comments

Hi! Is it supported, or should it be supported, to run multiple instances of Silicon in parallel, within the same process/JVM? What I tried to do was make multiple instances of viper.silicon.Silicon in different threads, but this seems to break in various ways. As an example, the instances race to set viper.silicon.verifier.Verifier._program, but it seemed there were more kinds of error (I did not investigate very deeply).

Cool! That improves things a lot. Still a couple errors I noticed though:

  1. I got this crash (which I can't stably reproduce). It seems logically impossible to me because the match/PartialFunction from GenericTriggerGenerator.scala:176-183 is defended by Strategy.scala:1116. I'll let you know if I get a reproducible example, otherwise maybe you see it immediately anyway.
scala.MatchError: l + k (of class viper.silver.ast.Add)
	at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:344)
	at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:342)
	at viper.silver.ast.utility.GenericTriggerGenerator$$anonfun$$nestedInanonfun$getFunctionAppsContaining$2$1.applyOrElse(GenericTriggerGenerator.scala:176)
	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:35)
	at viper.silver.ast.utility.rewriter.AddArtificialContext.apply(Strategy.scala:228)
	at viper.silver.ast.utility.rewriter.AddArtificialContext.apply(Strategy.scala:226)
	at viper.silver.ast.utility.rewriter.Rule.execute(Strategy.scala:1117)
	at viper.silver.ast.utility.rewriter.Strategy.rewriteInnermost(Strategy.scala:534)
	at viper.silver.ast.utility.rewriter.Strategy.selectStrat(Strategy.scala:356)
	at viper.silver.ast.utility.rewriter.Strategy.execute(Strategy.scala:371)
	at viper.silver.ast.Node.transform(Ast.scala:126)
        (...)
  1. We use my fork of silicon that includes #622, which makes the symbolic execution logger thread safe up to the internal parallelization of silicon, but contains global state, and is thus not externally parallelizable. I'd be happy to contribute a fix for that, since I've poked it last anyway :)

Yeah, I found the first issue, there's mutable state in GenericTriggerGenerator that I overlooked. Will fix that later today. Thanks!

The problem in the trigger generator should be fixed now.

I don't see further issues in silicon, so afaic this can be closed by #622