Commit 6362e224 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'ci/encoder-test' into 'main'

[CI]add encoder parameter statistics check to CI

See merge request !796
parents 00a01e81 662d6b24
Loading
Loading
Loading
Loading
Loading
+60 −19
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ variables:
  LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv"
  LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv"
  SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection"
  ENCODER_TEST_SUITE: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_basop_encoder.prm"
  TEST_SUITE: ""
  DUT_ENCODER_PATH: "./IVAS_cod"
  DUT_DECODER_PATH: "./IVAS_dec"
@@ -28,6 +29,8 @@ variables:
  CI_REGRESSION_THRESH_ODG: "-0.05"
  GIT_CLEAN_FLAGS: -ffdxq
  INSTR_DIR: "scripts/c-code_instrument"
  BUILD_WITH_DEBUG_MODE_INFO: ""
  ENCODER_TEST: ""
  MANUAL_PIPELINE_TYPE:
    description: "Type for the manual pipeline run. Use 'pytest-compare' to run comparison test against reference float codec."
    value: 'default'
@@ -117,11 +120,18 @@ stages:
    echo "Commit time was $CI_COMMIT_TIMESTAMP"
    date | xargs echo "System time is"

.activate-debug-mode-info-if-set: &activate-debug-mode-info-if-set
  - 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
  - fi

.build-reference-binaries: &build-reference-binaries
  - current_commit_sha=$(git rev-parse HEAD)
  ### build reference binaries
  - git checkout $REFERENCE_BRANCH
  - git pull
  - *activate-debug-mode-info-if-set
  - make clean
  - make -j
  - mv ./IVAS_cod ./$REF_ENCODER_PATH
@@ -136,6 +146,7 @@ stages:
### build reference binaries
  - *build-reference-binaries
### build dut binaries
  - *activate-debug-mode-info-if-set
  - make clean
  - make -j

@@ -147,7 +158,9 @@ stages:
  - python3 tests/create_short_testvectors.py
  # create references
  - exit_code=0
  - python3 -m pytest $TEST_SUITE -v --update_ref 1 --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$?
  - enc_stats_arg=""
  - if [ "$ENCODER_TEST" = "true" ]; then enc_stats_arg="--enc_stats"; fi
  - python3 -m pytest $TEST_SUITE -v --update_ref 1 $enc_stats_arg --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$?

.update-scripts-repo: &update-scripts-repo
  - cd $SCRIPTS_DIR
@@ -291,11 +304,17 @@ stages:
    - if [ $LEVEL_SCALING != "1.0" ];then
    -   *apply-testv-scaling
    - fi

    - if [ "$ENCODER_TEST" = "true" ]; then BUILD_WITH_DEBUG_MODE_INFO="true"; fi
    - *build-and-create-reference-outputs

    - comp_args="--mld --ssnr --odg"
    - if [ "$ENCODER_TEST" = "true" ]; then comp_args="${comp_args} --enc_stats"; fi
    - echo "$comp_args"

    ### run pytest
    - exit_code=0
    - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --ssnr --odg -n auto --testcase_timeout $testcase_timeout --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$?
    - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml $comp_args -n auto --testcase_timeout $testcase_timeout --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$?
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true

    - python3 scripts/parse_xml_report.py report-junit.xml $CSV_ARTIFACT_NAME
@@ -683,6 +702,24 @@ build-codec-linux-instrumented-make:
    - bash scripts/prepare_instrumentation.sh -m MEM_ONLY -p BASOP
    - make -j -C $INSTR_DIR

build-codec-linux-debugging-make:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web'
    - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main
    - if: $CI_PIPELINE_SOURCE == 'schedule'
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
  extends:
    - .build-job-linux
  timeout: "7 minutes"
  variables:
    BUILD_WITH_DEBUG_MODE_INFO: "true"
  script:
    - *print-common-info
    - *activate-debug-mode-info-if-set
    - make -j

# ---------------------------------------------------------------
# Short test jobs that run in merge request pipelines
# ---------------------------------------------------------------
@@ -771,8 +808,9 @@ ivas-pytest-compare_to_ref-short-enc:
    - .test-job-linux
  before_script:
    - USE_LTV=0
    - ENCODER_TEST="true"
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE"
    - TEST_SUITE="$ENCODER_TEST_SUITE"
    - LEVEL_SCALING=1.0
  <<: *ivas-pytest-anchor

@@ -783,8 +821,9 @@ ivas-pytest-compare_to_ref-short-enc-lev-10:
    - .test-job-linux    
  before_script:
    - USE_LTV=0
    - ENCODER_TEST="true"
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE"
    - TEST_SUITE="$ENCODER_TEST_SUITE"
    - LEVEL_SCALING=0.3162
  <<: *ivas-pytest-anchor

@@ -795,8 +834,9 @@ ivas-pytest-compare_to_ref-short-enc-lev+10:
    - .test-job-linux    
  before_script:
    - USE_LTV=0
    - ENCODER_TEST="true"
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE"
    - TEST_SUITE="$ENCODER_TEST_SUITE"
    - LEVEL_SCALING=3.162
  <<: *ivas-pytest-anchor

@@ -858,6 +898,7 @@ ivas-pytest-compare_to_ref-short-dec-lev+10:
    - LEVEL_SCALING=3.162
  <<: *ivas-pytest-anchor

### jobs that compare the output synthesis to the input files directly
ivas-pytest-compare-to-input-short-dec:
  extends:
    - .rules-pytest-to-input-short
+2 −0
Original line number Diff line number Diff line
@@ -2624,8 +2624,10 @@ Word16 ivas_smc_gmm_fx(
    mvs2s( &hSpMusClas->past_dec[0], &hSpMusClas->past_dec[1], HANG_LEN - 2 );
    hSpMusClas->past_dec[0] = dec;
    move16();
#ifndef IVAS_FLOAT_FIXED
#ifdef DEBUG_MODE_INFO
    dbgwrite( &st->hSpMusClas->wdlp_0_95_sp_32fx, sizeof( Word32 ), 1, 1, "res/wdlp_0_95_sp.x" );
#endif
#endif

    return dec;