Commit 02ad9859 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'update-basop-ci-branch' into 'basop-ci-branch'

[CI] Update basop-ci-branch

See merge request !2195
parents 6ebeecdd 6c7e785d
Loading
Loading
Loading
Loading
+42 −50
Original line number Diff line number Diff line
variables:
  # note: GitLab cannot reference variables defined by users in the include ref:, we need to use a YAML anchor for this
  # see https://docs.gitlab.com/ci/yaml/includes/#use-variables-with-include for more information
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF a31272de16bd1b556269a50bc179321a60f2a500
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF main

include:
  - local: .gitlab-ci/variables.yml
@@ -548,81 +548,69 @@ renderer-smoke-test:
      junit:
        - report-junit.xml

# test renderer executable with cmake + asan
renderer-asan:
.renderer-sanitizer-job:
  extends:
    - .test-job-linux
    - .rules-merge-request-to-main
  needs: ["build-codec-linux-cmake"]
  stage: test
  script:
    - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=asan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - testcase_timeout=180
    - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py --testcase_timeout=$testcase_timeout

  timeout: "30 minutes"
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
    expose_as: "renderer asan pytest results"
      - report.html
    reports:
      junit:
        - report-junit.xml
  before_script:
    - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=$SANITIZER_BUILD_STRING -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    # rename files to fit naming convention
    # en- and decoder needed because of split rendering testcases
    - mv IVAS_cod IVAS_cod_ref
    - mv IVAS_dec IVAS_dec_ref
    - mv IVAS_rend IVAS_rend_ref
    - mv ISAR_post_rend ISAR_post_rend_ref
    - testcase_timeout=180

# test renderer executable with cmake + asan
renderer-asan:
  extends:
    - .renderer-sanitizer-job
  variables:
    SANITIZER_BUILD_STRING: "asan"
  script:
    - python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --create_ref --testcase_timeout=$testcase_timeout
  artifacts:
    expose_as: "renderer asan result"


# test renderer executable with cmake + msan
renderer-msan:
  extends:
    - .test-job-linux
    - .rules-merge-request-to-main
  needs: ["build-codec-linux-cmake"]
  stage: test
    - .renderer-sanitizer-job
  variables:
    SANITIZER_BUILD_STRING: "msan"
  script:
    - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=msan  -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - testcase_timeout=180
    - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py --testcase_timeout=$testcase_timeout

    - python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --create_ref --testcase_timeout=$testcase_timeout
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
    expose_as: "renderer msan pytest results"
    reports:
      junit:
        - report-junit.xml
    expose_as: "renderer msan result"


# test renderer executable with cmake + usan
renderer-usan:
  extends:
    - .test-job-linux
    - .rules-merge-request-to-main
  needs: ["build-codec-linux-cmake"]
  stage: test
    - .renderer-sanitizer-job
  variables:
    SANITIZER_BUILD_STRING: "usan"
  script:
    - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=usan  -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - testcase_timeout=180
    - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1,log_path=usan_log_catchall python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py --testcase_timeout=$testcase_timeout
    - grep_exit_code=0
    - touch usan_log_empty # Creates an empty file, this is to avoid "grep: usan_log_*: No such file or directory" in case no USAN failures are reported from pytest
    - grep UndefinedBehaviorSanitizer usan_log_* || grep_exit_code=$?
    - if [ $grep_exit_code != 1 ] ; then echo "Run errors in test_renderer.py with Clang undefined-behavior-sanitizer"; exit 1; fi

    - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --create_ref --testcase_timeout=$testcase_timeout
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
    expose_as: "renderer usan pytest results"
    reports:
      junit:
        - report-junit.xml
    expose_as: "renderer usan result"


# compare renderer bitexactness between target and source branch
renderer-pytest-on-merge-request:
@@ -741,6 +729,7 @@ split-rendering-pytest-on-merge-request:
    - mv IVAS_cod IVAS_cod_ref
    - mv IVAS_dec IVAS_dec_ref
    - mv IVAS_rend IVAS_rend_ref
    - mv ISAR_post_rend ISAR_post_rend_ref

    ### If ref_using_main is not set, checkout the source branch to use scripts and input from there
    - if [ $ref_using_main == 0 ]; then git restore lib_com/options.h; fi # Revert changes back before checking out another branch to avoid conflicts
@@ -1266,6 +1255,7 @@ ivas-conformance:
    - cp -force IVAS_cod.exe IVAS_cod_ref.exe
    - cp -force IVAS_dec.exe IVAS_dec_ref.exe
    - cp -force IVAS_rend.exe IVAS_rend_ref.exe 
    - cp -force ISAR_post_rend.exe ISAR_post_rend_ref.exe
    
    # Reference creation
    - python scripts/prepare_combined_format_inputs.py
@@ -1331,6 +1321,7 @@ ivas-conformance:
    expire_in: 1 week
    when: always
    paths:
      - report_cmd.html
      - report-junit.xml
      - report.html
      - Readme_IVAS_dec.txt  
@@ -1359,6 +1350,7 @@ ivas-conformance-linux:
    - cp IVAS_cod IVAS_cod_ref
    - cp IVAS_dec IVAS_dec_ref
    - cp IVAS_rend IVAS_rend_ref
    - cp ISAR_post_rend ISAR_post_rend_ref
    
    # Reference creation
    - python3 scripts/prepare_combined_format_inputs.py
+2 −3
Original line number Diff line number Diff line
@@ -1858,13 +1858,13 @@ static ivas_error initOnFirstGoodFrame(
        return error;
    }

    int16_t *zeroBuf = malloc( pcmFrameSize * sizeof( int16_t ) );
    /* Write zeros to the output audio buffer */
    int16_t *zeroBuf = calloc( pcmFrameSize, sizeof( int16_t ) );
    if ( zeroBuf == NULL )
    {
        fprintf( stdout, "Error: Unable to allocate memory for output buffer.\n" );
        return IVAS_ERR_FAILED_ALLOC;
    }
    memset( zeroBuf, 0, pcmFrameSize * sizeof( int16_t ) );

    for ( int16_t i = 0; i < numInitialBadFrames; ++i )
    {
@@ -1888,7 +1888,6 @@ static ivas_error initOnFirstGoodFrame(
        }
        else
        {

            if ( *pRemainingDelayNumSamples < *numOutSamples )
            {
                if ( ( error = AudioFileWriter_write( *ppAfWriter, zeroBuf, *numOutSamples * *pNumOutChannels - ( *pRemainingDelayNumSamples * *pNumOutChannels ) ) ) != IVAS_ERR_OK )
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
   the software. This notice grants no license of any kind, including but not limited to patent
   license, nor is any license granted by implication, estoppel or otherwise.

   Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
   Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
   contributions.

+0 −8
Original line number Diff line number Diff line
@@ -681,9 +681,7 @@ int main(
    int argc,
    char **argv )
{
#ifdef FIX_1335_EXTREND_RETCODE
    bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
#endif
    ISAR_POST_REND_HANDLE hIsarPostRend = NULL;
    RotFileReader *headRotReader = NULL;
    RotFileReader *externalOrientationFileReader = NULL;
@@ -1225,10 +1223,8 @@ int main(
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/

#ifdef FIX_1335_EXTREND_RETCODE
    mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */

#endif
cleanup:

    free( inpInt16Buffer );
@@ -1259,11 +1255,7 @@ cleanup:
    print_mem( NULL );
#endif

#ifdef FIX_1335_EXTREND_RETCODE
    return mainFailed ? -1 : 0;
#else
    return 0;
#endif
}


+9 −10
Original line number Diff line number Diff line
@@ -659,9 +659,7 @@ int main(
    int argc,
    char **argv )
{
#ifdef FIX_1335_EXTREND_RETCODE
    bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
#endif
    IVAS_REND_HANDLE hIvasRend = NULL;
    RotFileReader *headRotReader = NULL;
    RotFileReader *externalOrientationFileReader = NULL;
@@ -1083,18 +1081,19 @@ int main(
            fprintf( stderr, "\nFailed to read renderer configuration from file %s\n", args.renderConfigFilePath );
            goto cleanup;
        }
#ifdef NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND

        if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, args.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", args.directivityPatternId[0], args.directivityPatternId[1], args.directivityPatternId[2], args.directivityPatternId[3] );
            goto cleanup;
        }

        if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
            goto cleanup;
        }
#endif

        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
            aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535;
@@ -1979,10 +1978,8 @@ int main(
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/

#ifdef FIX_1335_EXTREND_RETCODE
    mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */

#endif
cleanup:

    free( inpInt16Buffer );
@@ -2039,11 +2036,7 @@ cleanup:
    print_mem( NULL );
#endif

#ifdef FIX_1335_EXTREND_RETCODE
    return mainFailed ? -1 : 0;
#else
    return 0;
#endif
}


@@ -3498,14 +3491,20 @@ static void parseCombinedFormatInput(
        inConfig->numAmbisonicsBuses = 1;
        inConfig->ambisonicsBuses[0].audioConfig = audioConfig;
        inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects;
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
        inConfig->ambisonicsBuses[0].gain_dB = 0.f;
#else
        inConfig->ambisonicsBuses[0].gain_dB = -6.f;
#endif
        *configString += 4;

#ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
        /* Modify input gain for objects too */
        for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i )
        {
            inConfig->audioObjects[i].gain_dB = -6.f;
        }
#endif
    }
    else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 )
    {
Loading