diff --git a/ci.hocon b/ci.hocon index ff92a88670f808de6f90294ce2aacf30149a1360..9e85b47df51380e4d3737037c9d54df84d1f5a1d 100644 --- a/ci.hocon +++ b/ci.hocon @@ -148,7 +148,7 @@ rbcheck : ${common} { run : [ ${gateCmd} ["Versions,JDKReleaseInfo,BuildJavaWithJavac"] ["mx", "rbcheck"] - ["mx", "rbdiag", "-n", "-m"] + ["mx", "rbdiag"] ] } diff --git a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java index 4214170ebfd69c7a2d5efe62c2f4522d6709529c..809bf71bdebc1e335c4e84b0003c4ee3940b5730 100644 --- a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java +++ b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java @@ -236,7 +236,7 @@ class ChimneySweeping extends SingleBuiltinDiagnostics { } @Override - public void diagnoseBuiltin() throws Exception { + public boolean diagnoseBuiltin() throws Exception { // super.diagnoseBuiltin(); if (blacklistedBuiltins.contains(builtinName)) { @@ -244,10 +244,12 @@ class ChimneySweeping extends SingleBuiltinDiagnostics { } else { sweepChimney(); } + + return true; } @Override - protected void diagnosePipeline(int i) { + protected boolean diagnosePipeline(int i) { super.diagnosePipeline(i); print(1, " Samples:"); @@ -256,6 +258,8 @@ class ChimneySweeping extends SingleBuiltinDiagnostics { if (diagSuite.diagConfig.performPipelineSelfTest) { checkPipelines(i); } + + return true; } @SuppressWarnings({"rawtypes", "unchecked"}) diff --git a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/RBuiltinDiagnostics.java b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/RBuiltinDiagnostics.java index 2ab3ac955ae37a9d70be769c8dc9672812c3dce1..2fce7678ee125b824b806395b3ff792a41d5ca73 100644 --- a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/RBuiltinDiagnostics.java +++ b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/RBuiltinDiagnostics.java @@ -145,12 +145,13 @@ public class RBuiltinDiagnostics { boolean ok = true; try { - diag.init().diagnoseBuiltin(); + ok = diag.init().diagnoseBuiltin(); print(1, "Finished"); print(1, "--------"); } catch (WarningException e) { diag.print(0, "Warning: " + e.getMessage()); + ok = false; } catch (InfoException e) { print(0, e.getMessage()); } catch (Throwable e) { @@ -178,6 +179,7 @@ public class RBuiltinDiagnostics { diag = createBuiltinDiagnostics(new RIntBuiltinDiagFactory((bf))); } catch (WarningException e) { print(0, "Warning: " + e.getMessage()); + ok = false; continue; } catch (InfoException e) { print(1, e.getMessage()); @@ -186,12 +188,14 @@ public class RBuiltinDiagnostics { errCounter++; print(0, "Error in initialization of builtin " + bf.getName()); t.printStackTrace(); + ok = false; continue; } try { - diag.init().diagnoseBuiltin(); + ok &= diag.init().diagnoseBuiltin(); } catch (WarningException e) { diag.print(0, "Warning: " + e.getMessage()); + ok = false; } catch (InfoException e) { diag.print(1, e.getMessage()); } catch (Throwable t) { @@ -209,6 +213,7 @@ public class RBuiltinDiagnostics { diag = createBuiltinDiagnostics(RExtBuiltinDiagFactory.create(extBltCls)); } catch (WarningException e) { print(0, "Warning: " + e.getMessage()); + ok = false; continue; } catch (InfoException e) { print(1, e.getMessage()); @@ -217,12 +222,14 @@ public class RBuiltinDiagnostics { errCounter++; print(0, "Error in initialization of " + extBltCls.getName() + " builtin"); t.printStackTrace(); + ok = false; continue; } try { - diag.init().diagnoseBuiltin(); + ok &= diag.init().diagnoseBuiltin(); } catch (WarningException e) { diag.print(0, "Warning: " + e.getMessage()); + ok = false; } catch (InfoException e) { diag.print(1, e.getMessage()); } catch (Throwable t) { @@ -230,6 +237,7 @@ public class RBuiltinDiagnostics { ok = false; diag.print(0, ""); t.printStackTrace(); + ok = false; } } @@ -422,15 +430,19 @@ public class RBuiltinDiagnostics { return nonCovered; } - public void diagnoseBuiltin() throws Exception { + public boolean diagnoseBuiltin() throws Exception { + boolean ok = true; + print(1, "Argument cast pipelines binding:"); for (int i = 0; i < argLength; i++) { - diagnosePipeline(i); + ok &= diagnosePipeline(i); } print(1, "\nUnhandled argument combinations: " + nonCoveredArgsSet.size()); print(1, ""); + nonCoveredArgsSet.isEmpty(); + if (diagSuite.diagConfig.verbose) { for (List<Type> uncoveredArgs : nonCoveredArgsSet) { print(1, uncoveredArgs.stream().map(t -> typeName(t)).collect(Collectors.toList())); @@ -438,7 +450,9 @@ public class RBuiltinDiagnostics { } print(1, ""); - printDeadSpecs(); + ok &= printDeadSpecs(); + + return ok; } private void printBuiltinHeader(int level) { @@ -452,7 +466,8 @@ public class RBuiltinDiagnostics { } } - private void printDeadSpecs() { + private boolean printDeadSpecs() { + boolean ok = true; StringBuilder sb = new StringBuilder(); int deadSpecCnt = 0; for (Map.Entry<Method, List<Set<Cast>>> resTpPerSpec : convResultTypePerSpec.entrySet()) { @@ -471,13 +486,19 @@ public class RBuiltinDiagnostics { } } + ok = deadSpecCnt == 0; + int logLev = deadSpecCnt == 0 ? 1 : 0; String msg = deadSpecCnt == 0 ? "Dead specializations: " + deadSpecCnt : "Warning: Dead specializations: " + deadSpecCnt; print(logLev, msg); print(logLev, sb.toString()); + + return ok; } - protected void diagnosePipeline(int i) { + protected boolean diagnosePipeline(int i) { + boolean ok = true; + TypeExpr argResultSet = argResultSets.get(i); String pipelineHeader = "Pipeline for '" + parameterNames[i] + "' (arg[" + i + "])"; @@ -501,11 +522,13 @@ public class RBuiltinDiagnostics { if (unboundArgTypes.isEmpty()) { print(1, pipelineHeader); } else { + ok = false; print(0, "Warning: " + pipelineHeader); print(0, " Unbound types: " + unboundArgTypes.stream().map(argType -> typeName(argType)).collect(Collectors.toSet())); } print(1, sb.toString()); + return ok; } private List<TypeExpr> createArgResultSets() {