Commit 27e4f6ea authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into adjustments-for-updated-basop-ci-branch

parents f6f0941d 317ed8b0
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2,4 +2,3 @@ variables:
  FLOAT_REF_COMMIT_FILE: "float-ref-git-sha.txt"
  MERGE_SOURCE_FLOAT_REF_COMMIT_FILE: "merge-source-float-ref-git-sha.txt"
  MERGE_TARGET_COMMIT_FILE: "merge-target-git-sha.txt"
  FLOAT_REF_COMMIT: "ivas-float-update"
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ variables:
  GIT_CLEAN_FLAGS: -ffdxq
  TESTCASE_TIMEOUT_STV_SANITIZERS: 240
  TESTCASE_TIMEOUT_LTV_SANITIZERS: 2400
  BASOP_REFERENCE_BRANCH: "ivas-float-update"
  SCALE_FACTOR: "3.162"
  BASOP_CI_BRANCH_PC_REPO: "basop-ci-branch"
  PYTEST_ADDOPTS: ""
+30 −54
Original line number Diff line number Diff line
@@ -254,8 +254,8 @@ workflow:
    - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi
    - cp -r scripts/testv/* $TESTV_DIR/

# This anchor is the basis for manual and scheduled tests comparing to float ref (ivas-float-update)
.ivas-pytest-anchor: &ivas-pytest-anchor
# This anchor is the basis for manual and scheduled tests comparing to float ref (ivas-codec main branch)
.compare-to-ref-anchor: &compare-to-ref-anchor
  stage: test
  needs: ["build-codec-linux-make", "pytest-to-ref-pre"]
  timeout: "480 minutes"
@@ -293,10 +293,6 @@ workflow:
    -   BUILD_WITH_DEBUG_MODE_INFO="true"
    - fi

    - if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" == "ivas-float-update" ]; then
    -   export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not rtpdump'"
    - fi

    - INV_LEVEL_SCALING=$(awk "BEGIN {print 1.0 / $LEVEL_SCALING}")
    - comp_args="--mld --ssnr --odg --scalefac $INV_LEVEL_SCALING"
    - summary_args="MLD DIFF SSNR ODG"
@@ -436,14 +432,9 @@ workflow:
    -   bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/apply-testv-scaling.sh
    - fi

    # TODO: remove once ref branch is switched
    - export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not rtpdump'"

    - echo "$FLOAT_REF_BRANCH - $FLOAT_REF_BRANCH_MERGE_SOURCE - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME - $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
    # build merge target branch and correpsonding float reference
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh float-ref
    - source "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-merge-target-binaries.sh
    - echo "$FLOAT_REF_BRANCH - $FLOAT_REF_BRANCH_MERGE_SOURCE - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME - $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
    # build to-be-merged branch and corresponding float ref branch
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh dut
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh float-ref-merge-source
@@ -564,9 +555,6 @@ workflow:
    -   bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/apply-testv-scaling.sh
    - fi

    # TODO: remove once ref branch is switched
    - export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not rtpdump'"

    # check MR title for flag that allows regressions to be mergable
    - echo $CI_MERGE_REQUEST_TITLE > tmp.txt
    - allow_regressions_flag=$(grep -c --ignore-case "\[allow[ -]*regression\]" tmp.txt) || true
@@ -709,10 +697,6 @@ workflow:
    -   testcase_timeout_arg=""
    - fi

    - if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" == "ivas-float-update" ]; then
    -   export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not rtpdump'"
    - fi

    # NOTE: here we do not use the "DUT_..CODER_PATH" variables because we do not build via a script, but directly from the make file (which is done because of the "make_args" - no way to inject that into build-binaries.sh)
    - python3 -m pytest $TEST_SUITE -v --tb=no --update_ref 1 --html=report.html --self-contained-html --junit-xml=report-junit.xml $testcase_timeout_arg --ref_encoder_path IVAS_cod --ref_decoder_path IVAS_dec
  artifacts:
@@ -863,6 +847,7 @@ branch-is-up-to-date-with-target-pre:
  tags:
    - ivas-basop-linux
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/update-scripts-repo.sh
    - source "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/branch-is-up-to-date-with-target-pre.sh
  artifacts:
    paths:
@@ -939,15 +924,18 @@ clang-format-check:


# This job runs in manual jobs and scheduled jobs that compares to the float reference.
# It fetches the latest commit of ivas-float-update and stores in FLOAT_COMMIT_REF
# It fetches the latest commit of ivas-codec main and stores in FLOAT_COMMIT_REF
pytest-to-ref-pre:
  extends:
    - .job-linux
    - .rules-pytest-to-ref-pre
  stage: prevalidate
  script:
    - git fetch origin ivas-float-update
    - FLOAT_REF_COMMIT="$(git rev-parse "origin/ivas-float-update")"
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/update-scripts-repo.sh
    - pushd "${SCRIPTS_DIR}"
    - FLOAT_REF_COMMIT="$(git rev-parse "origin/main")"
    - popd
    - echo "$FLOAT_REF_COMMIT" > $FLOAT_REF_COMMIT_FILE
  artifacts:
    paths:
@@ -1371,10 +1359,6 @@ ivas-pytest-on-merge-request:
    -   export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not model'"
    - fi

    - if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" == "ivas-float-update" ]; then
    -   export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not rtpdump'"
    - fi

    ### prepare pytest
    # create references
    - python3 -m pytest "$TESTS_DIR_CODEC_BE_ON_MR"/"$PYTEST_SCRIPT" -v --update_ref 1
@@ -1585,10 +1569,6 @@ ivas-interop-on-merge-request:
    - source "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/merge-request-comparison-setup-codec.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/merge-request-print-pinned-commits.sh

    - if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" == "ivas-float-update" ]; then
    -   export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not rtpdump'"
    - fi

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    # write to temporary file as workaround for failures observed with piping echo
    - echo $CI_MERGE_REQUEST_TITLE > tmp.txt
@@ -1808,7 +1788,7 @@ renderer-usan:
        - report-junit-5ms.xml

# From float repo
# to be reused in MR and LTV-scheduled sanitizer test jobs
# to be reused in MR test jobs
# set CLANG_NUM, SELFTEST_SANITY_TIMEOUT and SELF_TEST_PRM_FILE in before_script section
.sanitizer-selftest-anchor: &sanitizer-selftest-anchor
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
@@ -1821,10 +1801,6 @@ renderer-usan:
    -   export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not model'"
    - fi

    - if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" == "ivas-float-update" ]; then
    -   export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} -k 'not rtpdump'"
    - fi

    - make_args="CLANG=$CLANG_NUM"
    # for MRs to main, the whole sanitizer test takes too long (even with stv set of inputs)
    # shorten files to 1s for that case
@@ -1918,7 +1894,7 @@ ivas-pytest-compare_to_ref-short-enc:
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=1.0
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

ivas-pytest-compare_to_ref-short-enc-lev-10:
  extends:
@@ -1930,7 +1906,7 @@ ivas-pytest-compare_to_ref-short-enc-lev-10:
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=0.3162
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

ivas-pytest-compare_to_ref-short-enc-lev+10:
  extends:
@@ -1942,7 +1918,7 @@ ivas-pytest-compare_to_ref-short-enc-lev+10:
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=3.162
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

# encoder dmx comparison jobs
ivas-pytest-compare_to_ref-dmx-short-enc:
@@ -1956,7 +1932,7 @@ ivas-pytest-compare_to_ref-dmx-short-enc:
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=1.0
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

ivas-pytest-compare_to_ref-dmx-short-enc-lev-10:
  extends:
@@ -1969,7 +1945,7 @@ ivas-pytest-compare_to_ref-dmx-short-enc-lev-10:
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=0.3162
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

ivas-pytest-compare_to_ref-dmx-short-enc-lev+10:
  extends:
@@ -1982,7 +1958,7 @@ ivas-pytest-compare_to_ref-dmx-short-enc-lev+10:
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=3.162
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

### jobs that test flt encoder -> fx decoder
ivas-pytest-compare_to_ref-short-dec:
@@ -1994,7 +1970,7 @@ ivas-pytest-compare_to_ref-short-dec:
    - DUT_ENCODER_PATH=./$REF_ENCODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE"
    - LEVEL_SCALING=1.0
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor
  
ivas-pytest-compare_to_ref-short-dec-lev-10:
  extends:
@@ -2005,7 +1981,7 @@ ivas-pytest-compare_to_ref-short-dec-lev-10:
    - DUT_ENCODER_PATH=./$REF_ENCODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE"
    - LEVEL_SCALING=0.3162
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor
  
ivas-pytest-compare_to_ref-short-dec-lev+10:
  extends:
@@ -2016,7 +1992,7 @@ ivas-pytest-compare_to_ref-short-dec-lev+10:
    - DUT_ENCODER_PATH=./$REF_ENCODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE"
    - LEVEL_SCALING=3.162
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

### jobs that compare the output synthesis to the input files directly
ivas-pytest-compare-to-input-short-dec:
@@ -2055,7 +2031,7 @@ ivas-pytest-compare_ref-long-enc:
    - TEST_SUITE="$LONG_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=1.0
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor
  
ivas-pytest-compare_ref-long-dec:
  extends:
@@ -2070,7 +2046,7 @@ ivas-pytest-compare_ref-long-dec:
    - TEST_SUITE="$LONG_TEST_SUITE"
    - LEVEL_SCALING=1.0
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor
  
ivas-pytest-compare_ref-long-enc-lev-10:
  extends:
@@ -2082,7 +2058,7 @@ ivas-pytest-compare_ref-long-enc-lev-10:
    - TEST_SUITE="$LONG_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=0.3162
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor
  
ivas-pytest-compare_ref-long-dec-lev-10:
  extends:
@@ -2097,7 +2073,7 @@ ivas-pytest-compare_ref-long-dec-lev-10:
    - TEST_SUITE="$LONG_TEST_SUITE"
    - LEVEL_SCALING=0.3162
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

ivas-pytest-compare_ref-long-enc-lev+10:
  extends:
@@ -2109,7 +2085,7 @@ ivas-pytest-compare_ref-long-enc-lev+10:
    - TEST_SUITE="$LONG_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=3.162
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor
  
ivas-pytest-compare_ref-long-dec-lev+10:
  extends:
@@ -2124,7 +2100,7 @@ ivas-pytest-compare_ref-long-dec-lev+10:
    - TEST_SUITE="$LONG_TEST_SUITE"
    - LEVEL_SCALING=3.162
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

ivas-pytest-compare_ref-long-fx-fx:
  extends:
@@ -2138,7 +2114,7 @@ ivas-pytest-compare_ref-long-fx-fx:
    - TEST_SUITE="$LONG_TEST_SUITE_NO_RENDERER"
    - LEVEL_SCALING=1.0
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

ivas-pytest-compare_ref-long-fx-fx-lev-10:
  extends:
@@ -2152,7 +2128,7 @@ ivas-pytest-compare_ref-long-fx-fx-lev-10:
    - TEST_SUITE="$LONG_TEST_SUITE_NO_RENDERER"
    - LEVEL_SCALING=0.3162
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

ivas-pytest-compare_ref-long-fx-fx-lev+10:
  extends:
@@ -2166,7 +2142,7 @@ ivas-pytest-compare_ref-long-fx-fx-lev+10:
    - TEST_SUITE="$LONG_TEST_SUITE_NO_RENDERER"
    - LEVEL_SCALING=3.162
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

### These next 3 jobs run three different sanitizers for fx -> fx codec chain usin

@@ -2456,7 +2432,7 @@ ivas-pytest-renderer:
    - USE_LTV=0
    - TEST_SUITE="tests/renderer"
    - LEVEL_SCALING=1.0
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

peaq-enc-passthrough:
  extends:
@@ -2469,7 +2445,7 @@ peaq-enc-passthrough:
    - TEST_SUITE="tests/test_enc_passthrough.py"
    - DELTA_ODG="true"
    - LEVEL_SCALING=1.0
  <<: *ivas-pytest-anchor
  <<: *compare-to-ref-anchor

# ---------------------------------------------------------------
# Various other tests
+0 −2
Original line number Diff line number Diff line
@@ -2,8 +2,6 @@

set -euxo pipefail

cd "${CI_PROJECT_DIR}"

if [ "$BUILD_WITH_DEBUG_MODE_INFO" = "true" ]; then
  sed -i.bak -e "s/\/\*\ *\(#define\ *DEBUGGING\ *\)\*\//\1/g" lib_com/options.h
  sed -i.bak -e "s/\/\*\ *\(#define\ *DEBUG_MODE_INFO\ *\)\*\//\1/g" lib_com/options.h
+22 −14
Original line number Diff line number Diff line
@@ -30,42 +30,50 @@

set -euxo pipefail

float_ref_branchname="ivas-float-update"
float_ref_branchname_in_ivas_codec="main"
exit_code_follows_naming_conventions=0
# if branch does not follow the convention, there will be a printout which is irrelevant here, so redirect it to null
bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/branch-follows-porting-naming-convention.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME >>/dev/null || exit_code_follows_naming_conventions=$?
# if this branch follows the naming convetions, we can try to get the corresponding float MR branch
# if this branch does NOT follow the porting naming convention, the float ref is just ivas-float-update, so skip everything
# if this branch does NOT follow the porting naming convention, the float ref is just ivas-codec main, so skip everything
if [[ "$exit_code_follows_naming_conventions" == "0" ]]; then
  float_ref_branchname=$(${CI_PROJECT_DIR}/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME)
  float_ref_branchname_in_ivas_codec=$(${CI_PROJECT_DIR}/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME)
fi

# fetch all needed branches
# fetch merge target and check if we are up-to-date
git fetch origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
git fetch origin ivas-float-update
git fetch origin "$float_ref_branchname"

# then check if we are behind the merge target
commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)"
if [ $commits_behind_count -ne 0 ]; then
  echo -e "Your branch is $commits_behind_count commits behind the target branch, run\n\tgit pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME\nto update."
  exit 1
fi

# if we are up-to-date, store the commit SHA for all branches

MERGE_TARGET_COMMIT="$(git rev-parse "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME")"
# to get the commit SHAs for the float reference branches, we need to get the main branch from float repo
# below here we will be in the float repo!
pushd "${SCRIPTS_DIR}"
git remote set-branches --add origin "$float_ref_branchname_in_ivas_codec"
git fetch origin "$float_ref_branchname_in_ivas_codec"

MERGE_SOURCE_FLOAT_REF_COMMIT="$(git rev-parse "origin/$float_ref_branchname_in_ivas_codec")"
FLOAT_REF_COMMIT="$(git rev-parse "origin/main")"
popd

# stop echoing from here on, this is anyway only dbg printout
set +x

# if we are up-to-date, store the commit SHA's for all branches
MERGE_TARGET_COMMIT="$(git rev-parse "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME")"
echo "MERGE_TARGET_COMMIT is $MERGE_TARGET_COMMIT"
echo "CI_COMMIT_SHA (on this branch $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME) is $CI_COMMIT_SHA"

echo "MERGE_TARGET_COMMIT (on branch $CI_MERGE_REQUEST_TARGET_BRANCH_NAME) is $MERGE_TARGET_COMMIT"
echo "$MERGE_TARGET_COMMIT" >"$MERGE_TARGET_COMMIT_FILE"

MERGE_SOURCE_FLOAT_REF_COMMIT="$(git rev-parse "origin/$float_ref_branchname")"
echo "MERGE_SOURCE_FLOAT_REF_COMMIT is $MERGE_SOURCE_FLOAT_REF_COMMIT"
echo "MERGE_SOURCE_FLOAT_REF_COMMIT (on branch $float_ref_branchname_in_ivas_codec in ivas-codec repo) is $MERGE_SOURCE_FLOAT_REF_COMMIT"
echo "$MERGE_SOURCE_FLOAT_REF_COMMIT" >"$MERGE_SOURCE_FLOAT_REF_COMMIT_FILE"

FLOAT_REF_COMMIT="$(git rev-parse "origin/ivas-float-update")"
echo "FLOAT_REF_COMMIT is $FLOAT_REF_COMMIT"
echo "FLOAT_REF_COMMIT (on branch main in ivas-codec repo) is $FLOAT_REF_COMMIT"
echo "$FLOAT_REF_COMMIT" >"$FLOAT_REF_COMMIT_FILE"

# create commits.env file for passing the variables to other jobs
Loading