Commit 3e2d96f5 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into ci/compare-tracefile-lengths-for-jbm-tests

parents e241bea3 d4574f97
Loading
Loading
Loading
Loading
Loading
+0 −49
Original line number Diff line number Diff line
@@ -43,9 +43,7 @@
#include "masa_file_writer.h"
#include "render_config_reader.h"
#include "rotation_file_reader.h"
#ifdef FIX_1053_REVERB_RECONFIGURATION
#include "aeid_file_reader.h"
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
#include "split_render_file_read_write.h"
#endif
@@ -93,7 +91,6 @@ static
 * Local structure for storing cmdln arguments
 *------------------------------------------------------------------------------------------*/

#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
    uint16_t *pID;
@@ -102,7 +99,6 @@ typedef struct
    uint16_t selected;
    uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif

typedef struct
{
@@ -155,11 +151,7 @@ typedef struct
    uint16_t tsmScale;
#endif
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
    AcousticEnvironmentSequence aeSequence;
#else
    uint16_t acousticEnvironmentId;
#endif
    int16_t Opt_dpid_on;
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];

@@ -456,14 +448,9 @@ int main(
     *------------------------------------------------------------------------------------------*/

    asked_frame_size = arg.renderFramesize;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -663,13 +650,11 @@ int main(
            fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
            goto cleanup;
        }
#ifdef CONF_DISTATT
        if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
            goto cleanup;
        }
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
@@ -698,11 +683,7 @@ int main(

        if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef FIX_1053_REVERB_RECONFIGURATION
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
@@ -712,11 +693,7 @@ int main(
            }
            else
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
#endif
                goto cleanup;
            }
            renderConfig.roomAcoustics.override = true;
@@ -931,13 +908,11 @@ cleanup:

    free( pcmBuf );

#ifdef FIX_1053_REVERB_RECONFIGURATION
    if ( arg.aeSequence.count > 0 )
    {
        free( arg.aeSequence.pID );
        free( arg.aeSequence.pValidity );
    }
#endif
#ifdef DEBUG_SBA_AUDIO_DUMP
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );

@@ -1153,15 +1128,11 @@ static bool parseCmdlIVAS_dec(
    arg->tsmScaleFileName = NULL;
#endif
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
    arg->aeSequence.count = 0;
    arg->aeSequence.pID = NULL;
    arg->aeSequence.pValidity = NULL;
    arg->aeSequence.selected = 0;
    arg->aeSequence.frameCounter = 0;
#else
    arg->acousticEnvironmentId = 65535;
#endif
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
        arg->directivityPatternId[i] = 65535;
@@ -1545,7 +1516,6 @@ static bool parseCmdlIVAS_dec(

            if ( !is_digits_only( argv[i] ) )
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                aeidFileReader *aeidReader = NULL;

                if ( aeidFileReader_open( argv[i], &aeidReader ) != IVAS_ERR_OK )
@@ -1565,13 +1535,7 @@ static bool parseCmdlIVAS_dec(
                aeidFileReader_close( &aeidReader );

                i++;
#else
                fprintf( stdout, "Error: Invalid acoustic environment ID specified: %s\n\n", argv[i] );
                usage_dec();
                return false;
#endif
            }
#ifdef FIX_1053_REVERB_RECONFIGURATION
            else
            {
                /* A single acoustic environment */
@@ -1586,9 +1550,6 @@ static bool parseCmdlIVAS_dec(
                arg->aeSequence.pID[0] = (int16_t) atoi( argv[i++] );
                arg->aeSequence.pValidity[0] = 0;
            }
#else
            arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
#endif
        }
        else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
        {
@@ -1834,13 +1795,9 @@ static void usage_dec( void )
    fprintf( stdout, "                      output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" );
    fprintf( stdout, "                      ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" );
    fprintf( stdout, "                      otherwise a default directivity pattern is used.\n" );
#ifdef FIX_1053_REVERB_RECONFIGURATION
    fprintf( stdout, "-aeid ID | File     : Acoustic environment ID (number > 0)\n" );
    fprintf( stdout, "                      alternatively, it can be a text file where each line contains \"ID duration\"\n" );
    fprintf( stdout, "                      for BINAURAL_ROOM_REVERB output configuration.\n" );
#else
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
#endif
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
    fprintf( stdout, "-q                  : Quiet mode, no frame counter\n" );
@@ -2269,7 +2226,6 @@ static ivas_error decodeG192(
    }
#endif

#ifdef FIX_1053_REVERB_RECONFIGURATION
    IVAS_RENDER_CONFIG_DATA renderConfig;
    RenderConfigReader *renderConfigReader = NULL;

@@ -2293,7 +2249,6 @@ static ivas_error decodeG192(
            goto cleanup;
        }
    }
#endif

    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
@@ -2504,7 +2459,6 @@ static ivas_error decodeG192(
        {
            if ( needNewFrame )
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
                     arg.aeSequence.count > 0 && arg.aeSequence.pValidity[arg.aeSequence.selected] != 0 )
                {
@@ -2535,7 +2489,6 @@ static ivas_error decodeG192(
                        }
                    }
                }
#endif
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
                if ( arg.tsmScaleFileEnabled )
@@ -2974,9 +2927,7 @@ static ivas_error decodeG192(

cleanup:

#ifdef FIX_1053_REVERB_RECONFIGURATION
    RenderConfigReader_close( &renderConfigReader );
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
    split_rend_reader_writer_close( &splitRendWriter );
#endif
+0 −48
Original line number Diff line number Diff line
@@ -45,9 +45,7 @@
#include "masa_file_writer.h"
#include "render_config_reader.h"
#include "rotation_file_reader.h"
#ifdef FIX_1053_REVERB_RECONFIGURATION
#include "aeid_file_reader.h"
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
#include "split_render_file_read_write.h"
#include "split_rend_bfi_file_reader.h"
@@ -145,7 +143,6 @@ typedef struct
    IVAS_CUSTOM_LS_DATA outSetupCustom;
} OutputConfig;

#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
    uint16_t *pID;
@@ -154,7 +151,6 @@ typedef struct
    uint16_t selected;
    uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif

typedef struct
{
@@ -195,11 +191,7 @@ typedef struct
    float syncMdDelay;
    IVAS_RENDER_FRAMESIZE render_framesize;
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
#ifdef FIX_1053_REVERB_RECONFIGURATION
    AcousticEnvironmentSequence aeSequence;
#else
    uint16_t acousticEnvironmentId;
#endif
} CmdlnArgs;

typedef enum
@@ -402,11 +394,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_acousticEnvironmentId,
        .match = "acoustic_environment_id",
        .matchShort = "aeid",
#ifdef FIX_1053_REVERB_RECONFIGURATION
        .description = "Acoustic environment ID (number > 0) alternatively, it can be a text file where each line contains \"ID duration\" for BINAURAL_ROOM_REVERB output configuration.",
#else
        .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration",
#endif
    },
};

@@ -740,10 +728,8 @@ int main(
    int16_t zeroPadToWrite = 0;
    int32_t delayTimeScale = 0;
    int16_t i, numChannels;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    IVAS_RENDER_CONFIG_DATA renderConfig;
    uint16_t aeID;
#endif
    ivas_error error = IVAS_ERR_OK;

#ifdef WMOPS
@@ -1058,9 +1044,6 @@ int main(

    if ( args.renderConfigFilePath[0] != '\0' )
    {
#ifndef FIX_1053_REVERB_RECONFIGURATION
        IVAS_RENDER_CONFIG_DATA renderConfig;
#endif

        /* sanity check */
#ifdef SPLIT_REND_WITH_HEAD_ROT
@@ -1095,12 +1078,8 @@ int main(

        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef FIX_1053_REVERB_RECONFIGURATION
            aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535;
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
@@ -1110,11 +1089,7 @@ int main(
            }
            else
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId );
#endif
                exit( -1 );
            }
            renderConfig.roomAcoustics.override = 1;
@@ -1545,16 +1520,11 @@ int main(
        num_in_channels = inBuffer.config.numChannels;
        const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0;

#ifdef FIX_1053_REVERB_RECONFIGURATION
        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
             args.aeSequence.count > 0 && args.aeSequence.pValidity[args.aeSequence.selected] != 0 )
        {
            if ( ++args.aeSequence.frameCounter >= args.aeSequence.pValidity[args.aeSequence.selected] )
            {
#ifndef FIX_1053_REVERB_RECONFIGURATION
                IVAS_RENDER_CONFIG_DATA renderConfig;

#endif
                if ( ++args.aeSequence.selected >= args.aeSequence.count )
                {
                    args.aeSequence.selected = 0;
@@ -1580,7 +1550,6 @@ int main(
                }
            }
        }
#endif

        numSamplesRead = 0;
        /* Read the input data */
@@ -2079,13 +2048,11 @@ cleanup:
    }
#endif

#ifdef FIX_1053_REVERB_RECONFIGURATION
    if ( args.aeSequence.count > 0 )
    {
        free( args.aeSequence.pID );
        free( args.aeSequence.pValidity );
    }
#endif
    for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
    {
        MasaFileReader_close( &masaReaders[i] );
@@ -2554,7 +2521,6 @@ static bool parseLfePositionConfig(
}


#ifdef FIX_1053_REVERB_RECONFIGURATION
static bool parseAcousticEnvironmentIds(
    const char *value,
    AcousticEnvironmentSequence *aeSequence )
@@ -2597,7 +2563,6 @@ static bool parseAcousticEnvironmentIds(

    return true;
}
#endif


static bool checkRequiredArgs(
@@ -2708,15 +2673,11 @@ static CmdlnArgs defaultArgs(
        args.directivityPatternId[i] = 65535;
    }

#ifdef FIX_1053_REVERB_RECONFIGURATION
    args.aeSequence.count = 0;
    args.aeSequence.pID = NULL;
    args.aeSequence.pValidity = NULL;
    args.aeSequence.selected = 0;
    args.aeSequence.frameCounter = 0;
#else
    args.acousticEnvironmentId = 65535;
#endif

    return args;
}
@@ -2888,19 +2849,10 @@ static void parseOption(
            break;
        case CmdLnOptionId_acousticEnvironmentId:
            assert( numOptionValues == 1 );
#ifdef FIX_1053_REVERB_RECONFIGURATION
            if ( !parseAcousticEnvironmentIds( optionValues[0], &args->aeSequence ) )
            {
                fprintf( stderr, "Invalid acoustic environment ID specified: %s\n", optionValues[0] );
            }
#else
            if ( !is_digits_only( optionValues[0] ) )
            {
                fprintf( stderr, "Invalid acousting environment ID specified: %s\n", optionValues[0] );
                exit( -1 );
            }
            args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 );
#endif
            break;
        case CmdLnOptionId_syncMdDelay:
            assert( numOptionValues == 1 );
+0 −6
Original line number Diff line number Diff line
@@ -13,10 +13,4 @@
    <li><a href="ivas-pytest-mld-long-dec-lev-10-index.html">ivas-pytest-mld-long-dec-lev-10</a></li>
  </ul>

  <h2>Test Coverage</h2>

  <br>
  tbd...
  </br>

</body>
+99 −32
Original line number Diff line number Diff line
import csv
import pathlib
import argparse
from functools import partial


CSV_DELIM = ";"
@@ -11,11 +12,14 @@ SUBPAGE_TMPL_CSS = """
  overflow:hidden;padding:10px 5px;word-break:normal;}
.tbase th{border-color:black;border-style:solid;border-width:1px;font-family:sans-serif;font-size:14px;
  font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tbase .tunder{font-weight:bold;text-align:center;text-decoration:underline;vertical-align:top}
.tbase .tcenter{font-weight:bold;text-align:center;vertical-align:top}
.tbase .tleft{text-align:left;vertical-align:top}
.tbase .tincrease{text-align:left;vertical-align:top;background-color:#ff0000;border-color:inherit;font-weight:bold;}
.tbase .treduce{text-align:left;vertical-align:top;background-color:#00ff00;border-color:inherit;font-weight:bold;}
.tbase .tunder{font-weight:bold;text-align:center;text-decoration:underline;}
.tbase .tcenter{font-weight:bold;text-align:center;}
.tbase .tleft{text-align:left;horizontal-align:bottom}
.tbase .tincrease{text-align:left;background-color:#ff5500;border-color:inherit;font-weight:bold;}
.tbase .treduce{text-align:left;background-color:#acff00;border-color:inherit;font-weight:bold;}

.arrowup {font-weight:bold;font-size:200%;}
.arrowdown {font-weight:bold;font-size:200%;}
</style>
"""

@@ -27,12 +31,41 @@ Comparing:
<ul>
    <li>Current run - id: <a href="https://forge.3gpp.org/rep/sa4/audio/ivas-basop/-/jobs/{id_current}">{id_current}</a></li>
    <li>Previous run - id: <a href="https://forge.3gpp.org/rep/sa4/audio/ivas-basop/-/jobs/{id_previous}">{id_previous}</a></li>
    <li><a href="{job_name}--merged_csv--{id_current}--{id_previous}.csv">Merged csv data</a></li>
    <li><a href="{job_name}--merged_csv--{id_current}.csv">Merged csv data</a></li>
</ul>

<br>
<b>Table is sorted by Difference in MLD with ERRORs or missing values ("None", "") being on top additionally.</b>
<b>How is the table sorted?</b>
<ul>
    <li>Cases with result ERROR or invalid/missing values for the numerical measures are given first</li>
    <li>Next are all cases with MLD(current) != MLD(previous), sorted in descending order (biggest MLD increase comes first)</li>
    <li>All cases with no difference in MLD are at the bottom</li>
</ul>
<br>
<b>What do the colours indicate</b>
<ul>
    <li>
        <span style="background-color:#ff5500;">Red background</span>:
        <ul>
            <li>This testcases either triggered an ERROR in the pytest run (probably a crash in the codec) or did not give valid values for the numerical measures (probably an error in the scripts).</li>
            <li>For this testcase the MLD increased wrt the previous run - MLD(current) > MLD(previous)</li>
        </ul>
    </li>
    <li>
        <span style="background-color:#acff00;">Green background</span>:
        <ul>
            <li>For this testcase the MLD decreased wrt the previous run - MLD(current) < MLD(previous)</li>
        </ul>
    </li>
</ul>
<br>
<b>How to interpret the Result column?</b>
<ul>
    <li>ERROR: An error occured during test run. It should be checked if a crash in the codec occured.</li>
    <li>FAIL: An MLD value > 0 was reported. This is to be expected, the test just reports a failure due to how the tests are currently implemented.</li>
    <li>PASS: MLD value of 0 was reported. This should only be the case for some special operating points and could indicate that parts of the codec are not (fully) converted yet.</li>
</ul>
<b>

<table class="tbase"><thead>
  <tr>
@@ -54,12 +87,15 @@ TH_TMPL_GLOBAL = '<th class="tunder" rowspan="2">{}</th>'
TH_TMPL_DIFFERENTIAL = '<th class="tunder" colspan="2">{}</th>'
TH_TMPL_SECOND_ROW = '<th class="tcenter">{}</th>'

ARROW_UP = '<span class="arrowup">&#11008;</span>'
ARROW_DOWN = '<span class="arrowdown">&#11010;</span>'

# expected columns. actual columns are filtered from the incoming data later, this
# is mainly for controlling the order in the output table
COLUMNS = ["testcase", "Result", "MLD", "MAXIMUM ABS DIFF"]
COLUMNS_GLOBAL = COLUMNS[:1]
COLUMNS_DIFFERENTIAL = COLUMNS[1:]

COLUMNS_DIFFERENTIAL_NOT_MLD = COLUMNS_DIFFERENTIAL[2:]

def create_subpage(
    html_out,
@@ -78,8 +114,8 @@ def create_subpage(
    table_header_a = "".join([TH_TMPL_GLOBAL.format(c) for c in COLUMNS_GLOBAL] + [TH_TMPL_DIFFERENTIAL.format(c) for c in COLUMNS_DIFFERENTIAL])
    table_header_b = list()
    for c in COLUMNS_DIFFERENTIAL:
        table_header_b.append(TH_TMPL_SECOND_ROW.format(id_previous))
        table_header_b.append(TH_TMPL_SECOND_ROW.format(id_current))
        table_header_b.append(TH_TMPL_SECOND_ROW.format(f"Previous Run<br>ID: {id_previous}"))
        table_header_b.append(TH_TMPL_SECOND_ROW.format(f"Current Run<br>ID: {id_current}"))
    table_header_b = "".join(table_header_b)
    table_body = "\n".join(
        tr_from_row(row, id_current, id_previous) for row in merged_reports
@@ -127,20 +163,30 @@ def tr_from_row(row, id_current, id_previous):
        prev = row[f"{c}-{id_previous}"]
        curr = row[f"{c}-{id_current}"]

        # use red background if increase, green if decrease, white if same
        td_tmpl = TD_TMPL_NORMAL
        if c == "Result":
            # print errors in bold red font
            td_tmpl = TD_TMPL_INCREASE if prev == "ERROR" else TD_TMPL_NORMAL
            tr.append(td_tmpl.format(prev))
            td_tmpl = TD_TMPL_INCREASE if curr == "ERROR" else TD_TMPL_NORMAL
            tr.append(td_tmpl.format(curr))
        else:
            td_tmpl_curr = TD_TMPL_NORMAL
            td_tmpl_prev = TD_TMPL_NORMAL
            try:
                if float(curr) > float(prev):
                td_tmpl = TD_TMPL_INCREASE
            if float(curr) < float(prev):
                td_tmpl = TD_TMPL_REDUCE
                    curr += f" {ARROW_UP}"
                    td_tmpl_curr = TD_TMPL_INCREASE
                elif float(curr) < float(prev):
                    curr += f" {ARROW_DOWN}"
                    td_tmpl_curr = TD_TMPL_REDUCE
            except ValueError:
                # if we land here, one of the cells is not a number, this indicates a crash
                # or some error in the scripts, so mark with red as well
            td_tmpl = TD_TMPL_INCREASE
                td_tmpl_curr = TD_TMPL_INCREASE
                td_tmpl_prev = TD_TMPL_INCREASE

        tr.append(td_tmpl.format(row[f"{c}-{id_previous}"]))
        tr.append(td_tmpl.format(row[f"{c}-{id_current}"]))
            tr.append(td_tmpl_prev.format(prev))
            tr.append(td_tmpl_curr.format(curr))

    return TR_TMPL.format("\n".join(tr))

@@ -165,17 +211,38 @@ def merge_and_cleanup_mld_reports(
    mld_col_curr = f"MLD-{id_current}"
    mld_col_prev = f"MLD-{id_previous}"

    # sort based on difference in MLD between current and previous run
    # put cases with "None" at the top of the list
    def sort_func(x):
        vals_missing = ["None", ""]

        if x[mld_col_curr] in vals_missing or x[mld_col_prev] in vals_missing:
    def sort_func(x, other_col_pairs):
        """
        Sort function for the rows. Puts missing or invalid values on top as those usually
        indicate crashes. Then sorts by MLD difference in descending order. MLD diffs of zero
        are uninteresting and are put last.
        """
        try:
            float(x[mld_col_curr])
            float(x[mld_col_prev])
        except ValueError:
            # Value is no valid floating point value
            return float("inf")

        return float(x[mld_col_curr]) - float(x[mld_col_prev])
        diff = float(x[mld_col_curr]) - float(x[mld_col_prev])

        # if no diff in mld col found, check if there is a diff in any other measure
        if diff == 0:
            diff = float("-inf")

            diff_other = 0
            for col_pair in other_col_pairs:
                col_prev = col_pair[0]
                col_curr = col_pair[1]
                diff_other += abs(float(x[col_curr]) - float(x[col_prev]))

            if diff_other > 0:
                diff = -1000000

        return diff

    merged = sorted(merged, key=sort_func, reverse=True)
    other_col_pairs = [(f"{col}-{id_previous}", f"{col}-{id_current}") for col in COLUMNS_DIFFERENTIAL_NOT_MLD]
    merged = sorted(merged, key=partial(sort_func, other_col_pairs=other_col_pairs), reverse=True)

    # remove the unecessary whole path from the testcase names
    for row in merged:
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ JOBS_FLOAT_REPO = [
]
JOBS_BASOP_REPO = [
    "ivas-pytest-mld-long-dec",
    "ivas-pytest-mld-long-dec-lev+10",
    "ivas-pytest-mld-long-dec-lev-10",
]

JOBS_FOR_PROJECT_ID = {
Loading