GithubHelp home page GithubHelp logo

lin-check's People

Contributors

free0u avatar ndkoval avatar tsitelov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lin-check's Issues

Parametrization of tests

Currently, the way runner is invoker via classname does not let itself easily to parametrization. Consider a datastructure with two modes of operation and we want to run lin-check with it without copy-and-paste:

class XxxTest(val mode: Boolean) {
    lateinit var ds: DataStructure

    @Reset { ds = DataStructure(mode) }

    // operations here

    @Test fun test() {
        val optinos = ... 
        LinChecker.check(XxxTest::class.java, options)
    }
}

This above code does not work, because there is not default constructor in XxxTest. If you extract common parts into a base class and make two inherited classes for each mode, then it does not work either, because lincheck cannot find @Reset method declared in a parent.

Some supported way of running parametrized tests is needed.

Generating all linearizable executions is very slow

LinkChecker.checkImpl method generates all possible executions and then uses executeActors(linEx) on each one. It is very slow, because it does TestThreadExecutionGenerator.create every time, defining new classes for each execution (instead of defining them just once and reusing). Because of this lincheck does not really scale to complex tests. In my case it "hangs" trying to produce executions for this schenario with four threads (4/4/4/2 operations):

Actors per thread:
[removeFirst()[w], removeFirst()[w], addLastIfPrevDiff(2)[w], removeFirstOrPeekIf(1)[w]]
[removeFirst()[w], addFirstIfEmpty(1)[w], addFirstIfEmpty(2)[w], addFirstIfEmpty(3)[w]]
[addLast(1)[w], addLastIfPrevDiff(3)[w], addFirst(2)[w], addLast(1)[w]]
[removeFirstOrPeekIf(2)[w], removeFirst()[w]]

How to check not linearizable data structure ?

`@StressCTest(iterations = 300, actorsPerThread = {"1:3", "1:3", "1:3"})
@param(name = "value", gen = IntGen.class)
public class LinkedList1 {

private List<Integer> list;

@Reset
public void reset() {
    list = new LinkedList<>();
}

@Operation(params = {"value"})
public void add(Integer value) {
    list.add(value);
}

@Operation(params = {"value"})
public void remove(Integer value) {
    list.remove(value);
}

@Test
public void test() {
    LinChecker.check(LinkedList1.class);
}

}`

This test is always true for Array & Linked list, it is okay, because they are not concurrent ?
Can you provide incorrect list or test for that ?

Provide support for testing of quiescent-consistency

Some useful data structures, like fast MPSC queues that are used for scheduling, are not linearizable, but give weaker guarantees like quiescent consistency in particular. It seems straightforward to extend lin-check methodology to support testing for quiescent consistency, too.

Note, that the existing framework for custom verifiers is not flexible enough to support that. It only support pluggable verification stage, while testing for quiescent consistency requires run a larger set of transpositions on original operation (all of the shall be tested without regard for program order).

References to generated classes do not seem to be released between iterations

If you run for a lot of iterations you end up with:

java.lang.OutOfMemoryError: Compressed class space

	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
	at com.devexperts.dxlab.lincheck.TestThreadExecutionGenerator$ExecutionClassLoader.define(TestThreadExecutionGenerator.java:266)
	at com.devexperts.dxlab.lincheck.TestThreadExecutionGenerator$ExecutionClassLoader.access$100(TestThreadExecutionGenerator.java:264)
	at com.devexperts.dxlab.lincheck.TestThreadExecutionGenerator.create(TestThreadExecutionGenerator.java:92)
	at com.devexperts.dxlab.lincheck.LinChecker.executeActors(LinChecker.java:193)
	at com.devexperts.dxlab.lincheck.LinChecker.lambda$checkImpl$4(LinChecker.java:140)
	at com.devexperts.dxlab.lincheck.LinChecker$$Lambda$21/457233904.apply(Unknown Source)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at com.devexperts.dxlab.lincheck.LinChecker.checkImpl(LinChecker.java:150)
	at com.devexperts.dxlab.lincheck.LinChecker.lambda$check$0(LinChecker.java:69)
	at com.devexperts.dxlab.lincheck.LinChecker$$Lambda$7/977993101.accept(Unknown Source)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at com.devexperts.dxlab.lincheck.LinChecker.check(LinChecker.java:67)
	at com.devexperts.dxlab.lincheck.LinChecker.check(LinChecker.java:60)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.