Loading scripts/basop_check_for_changes_in_testcases.py +30 −12 Original line number Diff line number Diff line Loading @@ -45,6 +45,9 @@ COLS_2_THRESHOLDS = { "MIN_ODG": float(os.environ.get("CI_REGRESSION_THRESH_ODG", -0.05)), } OUTFILE_CRASHES = "changes_crashes.csv" OUTFILE_SCORES = "changes_{}.csv" def main(args): df_curr = pd.read_csv(args.csv_current, sep=";") Loading @@ -52,7 +55,9 @@ def main(args): df_merged = pd.merge(df_curr, df_prev, on="testcase", suffixes=["-curr", "-prev"]) # remove leading path from testcase names for better readability df_merged["testcase"] = [pathlib.Path(tc).name for tc in df_merged["testcase"]] df_merged["testcase"] = [ pathlib.Path(tc).name.split("::")[-1] for tc in df_merged["testcase"] ] # this is for printing the whole testcase names pd.options.display.max_colwidth = 200 Loading @@ -69,15 +74,24 @@ def main(args): ) display_cols = ["testcase", col_curr, col_prev] df_crashes_introduced = df_merged[mask_crash_introduced][display_cols].reset_index( drop=True ) df_crashes_introduced.to_csv(OUTFILE_CRASHES, sep=";") if sum(mask_crash_introduced) > 0: regressions_found = True print("---------------Testcases that introduced new crashes---------------") print(df_merged[mask_crash_introduced][display_cols].reset_index(drop=True)) print(df_crashes_introduced) print() if args.show_improvements and sum(mask_crash_fixed) > 0: df_crashes_fixed = df_merged[mask_crash_fixed][display_cols].reset_index( drop=True ) df_crashes_fixed.to_csv(OUTFILE_CRASHES, mode="a", sep=";") print("---------------Testcases that fixed crashes---------------") print(df_merged[mask_crash_fixed][display_cols].reset_index(drop=True)) print(df_crashes_fixed) print() # remove columns with ERRORs in any of the csv files before comparing the numerical columns Loading @@ -88,31 +102,35 @@ def main(args): for col in args.columns_to_compare: col_curr = f"{col}-curr" col_prev = f"{col}-prev" diff = df_merged[col_curr] - df_merged[col_prev] col_diff = f"{col}-diff" df_merged[col_diff] = df_merged[col_curr] - df_merged[col_prev] thresh = COLS_2_THRESHOLDS[col] # invert sign of difference for "higher is better" metrics if thresh < 0: diff *= -1 fac = -1 if thresh < 0 else 1 thresh = abs(thresh) mask_worse = diff > thresh mask_better = diff < -thresh mask_worse = (df_merged[col_diff] * fac) > thresh mask_better = (df_merged[col_diff] * fac) < -thresh display_cols = ["testcase", col_curr, col_prev] display_cols = ["testcase", col_curr, col_prev, col_diff] outfile = OUTFILE_SCORES.format(col.replace(" ", "_")) df_worse = df_merged[mask_worse][display_cols].reset_index(drop=True) df_worse.to_csv(outfile, sep=";") if sum(mask_worse) > 0: regressions_found = True print( f"---------------Testcases that got worse wrt to {col}---------------" ) print(df_merged[mask_worse][display_cols].reset_index(drop=True)) print(df_worse) print() if args.show_improvements and sum(mask_better) > 0: df_better = df_merged[mask_better][display_cols].reset_index(drop=True) df_better.to_csv(outfile, mode="a", sep=";") print( f"---------------Testcases that got better wrt to {col}---------------" ) print(df_merged[mask_better][display_cols].reset_index(drop=True)) print(df_better) print() return int(regressions_found) Loading scripts/prepare_instrumentation.sh +9 −4 Original line number Diff line number Diff line Loading @@ -49,13 +49,13 @@ while getopts "m:p:h" OPTIONS; do case ${OPTIONS} in m) MODE=${OPTARG^^} if [ "$MODE" != "FULL" && "$MODE" != "MEM_ONLY" ]; then if [ "$MODE" != "FULL" -a "$MODE" != "MEM_ONLY" ]; then usage fi ;; p) PROJECT=${OPTARG^^} if [ "$PROJECT" != "FLOAT" && "$PROJECT" != "BASOP" ]; then if [ "$PROJECT" != "FLOAT" -a "$PROJECT" != "BASOP" ]; then usage fi ;; Loading Loading @@ -108,7 +108,9 @@ mkdir $targetdir cp -R ../lib_* $targetdir cp -R ../apps $targetdir cp -R ../Makefile $targetdir if [ "$PROJECT" = "FLOAT" ]; then cp -R ../CMakeLists.txt $targetdir fi cp -R ../Workspace_msvc $targetdir # back up #ifdef-list Loading Loading @@ -165,11 +167,14 @@ if coan_exists; then sed -i "/-DWMOPS/d" $ifdef_list sed -i "/-UMEM_COUNT_DETAILS/d" $ifdef_list coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,isar,rend,util,debug}/!(wmc_auto*).[hc] coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/apps/*.[hc] if [ "$PROJECT" = "FLOAT" ]; then coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,isar,rend,util,debug}/!(wmc_auto*).[hc] coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/!(wmc_auto*).[hc] coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/fft/!(wmc_auto*).[hc] else # same as first call from if, but without "isar" and "debug" to avoid coan warning coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,rend,util}/!(wmc_auto*).[hc] fi else ./strip_defines_cppp.sh $targetdir $ifdef_list Loading Loading
scripts/basop_check_for_changes_in_testcases.py +30 −12 Original line number Diff line number Diff line Loading @@ -45,6 +45,9 @@ COLS_2_THRESHOLDS = { "MIN_ODG": float(os.environ.get("CI_REGRESSION_THRESH_ODG", -0.05)), } OUTFILE_CRASHES = "changes_crashes.csv" OUTFILE_SCORES = "changes_{}.csv" def main(args): df_curr = pd.read_csv(args.csv_current, sep=";") Loading @@ -52,7 +55,9 @@ def main(args): df_merged = pd.merge(df_curr, df_prev, on="testcase", suffixes=["-curr", "-prev"]) # remove leading path from testcase names for better readability df_merged["testcase"] = [pathlib.Path(tc).name for tc in df_merged["testcase"]] df_merged["testcase"] = [ pathlib.Path(tc).name.split("::")[-1] for tc in df_merged["testcase"] ] # this is for printing the whole testcase names pd.options.display.max_colwidth = 200 Loading @@ -69,15 +74,24 @@ def main(args): ) display_cols = ["testcase", col_curr, col_prev] df_crashes_introduced = df_merged[mask_crash_introduced][display_cols].reset_index( drop=True ) df_crashes_introduced.to_csv(OUTFILE_CRASHES, sep=";") if sum(mask_crash_introduced) > 0: regressions_found = True print("---------------Testcases that introduced new crashes---------------") print(df_merged[mask_crash_introduced][display_cols].reset_index(drop=True)) print(df_crashes_introduced) print() if args.show_improvements and sum(mask_crash_fixed) > 0: df_crashes_fixed = df_merged[mask_crash_fixed][display_cols].reset_index( drop=True ) df_crashes_fixed.to_csv(OUTFILE_CRASHES, mode="a", sep=";") print("---------------Testcases that fixed crashes---------------") print(df_merged[mask_crash_fixed][display_cols].reset_index(drop=True)) print(df_crashes_fixed) print() # remove columns with ERRORs in any of the csv files before comparing the numerical columns Loading @@ -88,31 +102,35 @@ def main(args): for col in args.columns_to_compare: col_curr = f"{col}-curr" col_prev = f"{col}-prev" diff = df_merged[col_curr] - df_merged[col_prev] col_diff = f"{col}-diff" df_merged[col_diff] = df_merged[col_curr] - df_merged[col_prev] thresh = COLS_2_THRESHOLDS[col] # invert sign of difference for "higher is better" metrics if thresh < 0: diff *= -1 fac = -1 if thresh < 0 else 1 thresh = abs(thresh) mask_worse = diff > thresh mask_better = diff < -thresh mask_worse = (df_merged[col_diff] * fac) > thresh mask_better = (df_merged[col_diff] * fac) < -thresh display_cols = ["testcase", col_curr, col_prev] display_cols = ["testcase", col_curr, col_prev, col_diff] outfile = OUTFILE_SCORES.format(col.replace(" ", "_")) df_worse = df_merged[mask_worse][display_cols].reset_index(drop=True) df_worse.to_csv(outfile, sep=";") if sum(mask_worse) > 0: regressions_found = True print( f"---------------Testcases that got worse wrt to {col}---------------" ) print(df_merged[mask_worse][display_cols].reset_index(drop=True)) print(df_worse) print() if args.show_improvements and sum(mask_better) > 0: df_better = df_merged[mask_better][display_cols].reset_index(drop=True) df_better.to_csv(outfile, mode="a", sep=";") print( f"---------------Testcases that got better wrt to {col}---------------" ) print(df_merged[mask_better][display_cols].reset_index(drop=True)) print(df_better) print() return int(regressions_found) Loading
scripts/prepare_instrumentation.sh +9 −4 Original line number Diff line number Diff line Loading @@ -49,13 +49,13 @@ while getopts "m:p:h" OPTIONS; do case ${OPTIONS} in m) MODE=${OPTARG^^} if [ "$MODE" != "FULL" && "$MODE" != "MEM_ONLY" ]; then if [ "$MODE" != "FULL" -a "$MODE" != "MEM_ONLY" ]; then usage fi ;; p) PROJECT=${OPTARG^^} if [ "$PROJECT" != "FLOAT" && "$PROJECT" != "BASOP" ]; then if [ "$PROJECT" != "FLOAT" -a "$PROJECT" != "BASOP" ]; then usage fi ;; Loading Loading @@ -108,7 +108,9 @@ mkdir $targetdir cp -R ../lib_* $targetdir cp -R ../apps $targetdir cp -R ../Makefile $targetdir if [ "$PROJECT" = "FLOAT" ]; then cp -R ../CMakeLists.txt $targetdir fi cp -R ../Workspace_msvc $targetdir # back up #ifdef-list Loading Loading @@ -165,11 +167,14 @@ if coan_exists; then sed -i "/-DWMOPS/d" $ifdef_list sed -i "/-UMEM_COUNT_DETAILS/d" $ifdef_list coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,isar,rend,util,debug}/!(wmc_auto*).[hc] coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/apps/*.[hc] if [ "$PROJECT" = "FLOAT" ]; then coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,isar,rend,util,debug}/!(wmc_auto*).[hc] coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/!(wmc_auto*).[hc] coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/fft/!(wmc_auto*).[hc] else # same as first call from if, but without "isar" and "debug" to avoid coan warning coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,rend,util}/!(wmc_auto*).[hc] fi else ./strip_defines_cppp.sh $targetdir $ifdef_list Loading