Commit 27ca151d authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

retarget to main, revert relevant files

parent 921a8fb6
Loading
Loading
Loading
Loading
Loading
+12 −30
Original line number Diff line number Diff line
@@ -45,9 +45,6 @@ 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=";")
@@ -55,9 +52,7 @@ 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.split("::")[-1] for tc in df_merged["testcase"]
    ]
    df_merged["testcase"] = [pathlib.Path(tc).name for tc in df_merged["testcase"]]

    # this is for printing the whole testcase names
    pd.options.display.max_colwidth = 200
@@ -74,24 +69,15 @@ 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_crashes_introduced)
        print(df_merged[mask_crash_introduced][display_cols].reset_index(drop=True))
        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_crashes_fixed)
        print(df_merged[mask_crash_fixed][display_cols].reset_index(drop=True))
        print()

    # remove columns with ERRORs in any of the csv files before comparing the numerical columns
@@ -102,35 +88,31 @@ def main(args):
    for col in args.columns_to_compare:
        col_curr = f"{col}-curr"
        col_prev = f"{col}-prev"
        col_diff = f"{col}-diff"
        df_merged[col_diff] = df_merged[col_curr] - df_merged[col_prev]
        diff = df_merged[col_curr] - df_merged[col_prev]

        thresh = COLS_2_THRESHOLDS[col]
        # invert sign of difference for "higher is better" metrics
        fac = -1 if thresh < 0 else 1
        if thresh < 0:
            diff *= -1

        thresh = abs(thresh)
        mask_worse = (df_merged[col_diff] * fac) > thresh
        mask_better = (df_merged[col_diff] * fac) < -thresh
        mask_worse = diff > thresh
        mask_better = diff < -thresh

        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=";")
        display_cols = ["testcase", col_curr, col_prev]
        if sum(mask_worse) > 0:
            regressions_found = True
            print(
                f"---------------Testcases that got worse wrt to {col}---------------"
            )
            print(df_worse)
            print(df_merged[mask_worse][display_cols].reset_index(drop=True))
            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_better)
            print(df_merged[mask_better][display_cols].reset_index(drop=True))
            print()

    return int(regressions_found)
+4 −9
Original line number Diff line number Diff line
@@ -49,13 +49,13 @@ while getopts "m:p:h" OPTIONS; do
    case ${OPTIONS} in
    m)
        MODE=${OPTARG^^}
        if [ "$MODE" != "FULL" -a "$MODE" != "MEM_ONLY" ]; then
        if [ "$MODE" != "FULL" && "$MODE" != "MEM_ONLY" ]; then
            usage
        fi
        ;;
    p)
        PROJECT=${OPTARG^^}
        if [ "$PROJECT" != "FLOAT" -a "$PROJECT" != "BASOP" ]; then
        if [ "$PROJECT" != "FLOAT" && "$PROJECT" != "BASOP" ]; then
            usage
        fi
        ;;
@@ -108,9 +108,7 @@ 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
@@ -167,14 +165,11 @@ 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