changeset 20:4155566a6bfb

generator: canonicalize multitraces, skip a significant amount of homomorphic tests
author shade
date Tue, 09 Jul 2013 14:29:35 +0400
parents d25a6d5c6229
children f93f7ba162d8
files generator/src/main/java/org/openjdk/jcstress/tracer/TraceGen.java
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/generator/src/main/java/org/openjdk/jcstress/tracer/TraceGen.java	Tue Jul 09 14:23:49 2013 +0400
+++ b/generator/src/main/java/org/openjdk/jcstress/tracer/TraceGen.java	Tue Jul 09 14:29:35 2013 +0400
@@ -110,8 +110,12 @@
             }
         }
 
+        Set<String> processedMultitraces = new HashSet<String>();
+
         int testCount = 0;
         for (MultiTrace mt : multiTraces) {
+            if (!processedMultitraces.add(mt.id())) continue;
+
             List<Trace> linearTraces = mt.linearize();
             Set<Map<Integer, Integer>> scResults = new HashSet<Map<Integer, Integer>>();
             Set<Map<Integer, Integer>> allResults = new HashSet<Map<Integer, Integer>>();
@@ -477,6 +481,13 @@
                 if (!t.ops.isEmpty())
                     traces.add(t);
             }
+
+            Collections.sort(traces, new Comparator<Trace>() {
+                @Override
+                public int compare(Trace o1, Trace o2) {
+                    return o1.id().compareTo(o2.id());
+                }
+            });
         }
 
         public List<Trace> linearize() {