Commit dbfda01a authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into ci/fix-network-simulator-binary

parents 7ab95b15 4de46376
Loading
Loading
Loading
Loading
Loading
+53 −82
Original line number Diff line number Diff line
@@ -38,10 +38,11 @@ workflow:
stages:
  - .pre
  - maintenance
  - prevalidate
  - build
  - test
  - compare
  - validate
  - postvalidate
  - deploy

# ---------------------------------------------------------------
@@ -133,6 +134,14 @@ stages:
  - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)[[:space:]]*\*\//\1/g" ./lib_com/options.h
  - sed -i.bak -e "s/\/\/[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)/\1/g"        ./lib_com/options.h

.get-commits-behind-count: &get-commits-behind-count
  - echo $CI_COMMIT_SHA
  - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
  - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)

.check-commits-behind-count-in-compare-jobs: &check-commits-behind-count-in-compare-jobs
  - if [ $commits_behind_count -ne 0 ]; then echo "Your branch is not up-to-date with main -> Compare tests will not run as they can contain false negatives this way.\nMain might have changed during your pipeline run. Run 'git merge origin/main' to update."; exit 1; fi

# ---------------------------------------------------------------
# Job templates
# ---------------------------------------------------------------
@@ -179,11 +188,13 @@ stages:
.build-job-linux:
  stage: build
  timeout: "4 minutes"
  needs: []
  tags:
    - ivas-linux

.build-job-windows:
  stage: build
  needs: []
  timeout: "4 minutes"
  tags:
    - ivas-windows
@@ -236,19 +247,28 @@ uninterruptible:
# Validation jobs
# ---------------------------------------------------------------

check-if-branch-is-up-to-date-with-main:
branch-is-up-to-date-with-main-pre:
  extends:
    - .rules-merge-request
  stage: validate
  stage: prevalidate
  needs: []
  tags:
    - ivas-linux
  script:
    - echo $CI_COMMIT_SHA
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)
    - *get-commits-behind-count
    - echo $commits_behind_count
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, run 'git merge origin/main' to update."; exit 1; fi;

branch-is-up-to-date-with-main-post:
  extends:
    - .rules-merge-request
  stage: postvalidate
  tags:
    - ivas-linux
  script:
    - *get-commits-behind-count
    - echo $commits_behind_count
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else exit 1; fi;
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, possibly main changed during your pipeline run, run 'git merge origin/main' to update." exit 1; fi;

# ---------------------------------------------------------------
# Build jobs
@@ -530,6 +550,8 @@ renderer-pytest-on-merge-request:
  stage: compare
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    # write to temporary file as workaround for failures observed with piping echo
@@ -611,6 +633,8 @@ split-rendering-pytest-on-merge-request:
  stage: compare
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    # write to temporary file as workaround for failures observed with piping echo
@@ -674,6 +698,8 @@ ivas-pytest-on-merge-request:
  timeout: "10 minutes"
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs
    - *merge-request-comparison-setup-codec

    # some helper variables - "|| true" to prevent failures from grep not finding anything
@@ -726,6 +752,8 @@ evs-pytest-on-merge-request:
  timeout: "10 minutes"
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs
    - *merge-request-comparison-setup-codec

    # some helper variables - "|| true" to prevent failures from grep not finding anything
@@ -770,8 +798,8 @@ voip-be-on-merge-request:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  stage: compare # Or should it be test? Comparison is done within one git revision
  needs: ["build-codec-linux-make", codec-smoke-test]
  stage: test
  needs: ["build-codec-linux-make", "codec-smoke-test"]
  timeout: "10 minutes"
  script:
    - *print-common-info
@@ -783,7 +811,7 @@ clang-format-check:
    - .rules-merge-request
  variables:
    ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--formatting-fix"
  stage: validate
  stage: prevalidate
  needs: []
  timeout: "5 minutes"
  script:
@@ -830,7 +858,7 @@ check-first-frame-is-sid:
  tags:
    - ivas-linux
  stage: test
  # needs: ["build-codec-linux-cmake"]
  needs: ["build-codec-linux-cmake"]
  script:
    - *print-common-info
    - *update-ltv-repo
@@ -841,13 +869,16 @@ check-first-frame-is-sid:
    - make -j

    # TODO: for some MASA modes, we currently do not have testvectors that actually trigger DTX
    # SBA is run separately to use shorter part of file
    # SBA modes are run separately to use shorter part of file
    - exit_code_no_sba=0
    - exit_code_sba=0
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -v MASA | grep -v SBA)
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 500 -U 0:20 || exit_code_no_sba=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep SBA)
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 500 -U 70:80 || exit_code_sba=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -v MASA | grep -vE "FOA|HOA" )
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 200 -U 0:20 || exit_code_no_sba=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA")
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 || exit_code_sba=$?
    # need to do FOA separately as VAD apparently behaves differently there
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA")
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 || exit_code_sba=$?
    - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_sba -ne 0 ]; then exit 1; fi
  artifacts:
    paths:
@@ -857,50 +888,11 @@ check-first-frame-is-sid:
    expose_as: "logs-sidstart"
    expire_in: "5 days"

selection-test-processing:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  tags:
    - processing-scripts-linux
  stage: test
  needs: ["build-codec-linux-make"]
  script:
    # get processing script code
    - git clone https://forge.3gpp.org/rep/ivas-codec-pc/ivas-processing-scripts.git --single-branch -b main

    - mkdir -p ivas-processing-scripts/tests/data/testv
    - cp -r scripts/testv/* ivas-processing-scripts/tests/data/testv/

    # copy binaries into local bin dir, those should take precendence over PATH
    - cp $PROCESSING_SCRIPTS_BIN_DIR/* ivas-processing-scripts/ivas_processing_scripts/bin/
    # for testing with native binaries
    - rm ivas-processing-scripts/ivas_processing_scripts/bin/IVAS*.exe
    - rm ivas-processing-scripts/ivas_processing_scripts/bin/EVS*.exe

    # build codec and put into bin dir
    - make -j
    - cp ./IVAS_* ivas-processing-scripts/ivas_processing_scripts/bin/

    # patch the use_windows_codec_binaries key (weird folding is needed so colons are accepted)
    - >
      sed -i "s/use_windows_codec_binaries: true/use_windows_codec_binaries: false/" ivas-processing-scripts/experiments/selection/*/config/*.yml

    # run experiments test
    - cd ivas-processing-scripts
    - python3 -m pytest tests/test_experiments.py::test_generate_test_items -n auto | tee log.txt
  artifacts:
    paths:
      - ivas-processing-scripts/experiments/selection/*/proc_output/*.log
      - log.txt
    when: on_failure
    expire_in: 1 week

lc3plus-ensure-no-code-changes:
  extends:
    - .test-job-linux
    - .rules-merge-request
  stage: validate
  stage: postvalidate
  needs: []
  timeout: "5 minutes"
  script:
@@ -1256,15 +1248,15 @@ sanitizer-test-mc-7_1_4:
    - .sanitizer-test-template
  timeout: 6 hours

sanitizer-test-sba:
sanitizer-test-hoa3:
  extends: .sanitizer-test-schedule-C
  rules:
    - if: $SANITIZER_SCHEDULE_C
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py SBA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS
    - python3 ci/run_scheduled_sanitizer_test.py HOA3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-planarsba:
sanitizer-test-planarhoa3:
  extends: .sanitizer-test-schedule-C
  rules:
    - if: $SANITIZER_SCHEDULE_C
@@ -1272,7 +1264,7 @@ sanitizer-test-planarsba:
      start_in: 6 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py PlanarSBA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS
    - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

### --- sanitizer schedule D ---

@@ -1457,7 +1449,7 @@ complexity-sba-hoa3-in-hoa3-out:
    - *print-common-info
    - *update-ltv-repo
    - *complexity-measurements-setup
    - in_format=SBA
    - in_format=HOA3
    - out_format=HOA3
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format"
    - ret_val=$?
@@ -1522,27 +1514,6 @@ complexity-StereoDmxEVS-stereo-in-mono-out:
# Other jobs
# ---------------------------------------------------------------

upload-selection-BE-log:
  rules:
    - if: $UPLOAD_SELECTION_BE_RESULTS && $CI_PIPELINE_SOURCE == 'trigger'
      when: always
  timeout: 5 minutes
  tags:
    - ericsson-windows-runner
  script:
    - cp -r $SELECTION_BE_RESULT ./selection-BE-result
    - Get-Content -Path selection-BE-result/public_log--sha-*.txt
    - $has_failed_debugging_active = (Select-String -Path selection-BE-result/public_log--sha-*.txt -Pattern '^FAILED tests' -CaseSensitive).Line
    - Get-Content -Path selection-BE-result/public_log_DEBUGGING_inactive--sha-*.txt
    - $has_failed_debugging_inactive = (Select-String -Path selection-BE-result/public_log_DEBUGGING_inactive--sha-*.txt -Pattern '^FAILED tests' -CaseSensitive).Line
    - If($has_failed_debugging_active -or $has_failed_debugging_inactive) {exit -1}
  artifacts:
    paths:
      - selection-BE-result/public_log--sha-*.txt
      - selection-BE-result/public_log_DEBUGGING_inactive--sha-*.txt
    when: always
    expire_in: 1 week

# job that sets up gitlab pages website
pages:
  stage: deploy
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ echo "\n======================= 5. JBM, modes with EXT =======================\n
./scripts/runIvasCodec.py  $verbosity_cmd -m $modes_with_ext_out -p $cfg $duration_arg $WORKERS --decoder_only --jbm_file $dly_profile --oc BINAURAL BINAURAL_ROOM_IR mono stereo FOA HOA3 5_1 7_1_4 | tee -a smoke_test_output_jbm_noEXT.txt

# run all modes with binaural output using external files
modes_with_bin_out="SBA PlanarSBA MASA MC ISM1 ISM2 ISM3 ISM4"
modes_with_bin_out="FOA HOA2 HOA3 PlanarFOA PlanarHOA2 PlanarHOA3 MASA MC ISM1 ISM2 ISM3 ISM4"
bin_out_modes="BINAURAL BINAURAL_ROOM_IR"

echo "\n======================= 6. binaural out with HRTF files - WB =======================\n\n"
+684 −30

File changed.

Preview size limit exceeded, changes collapsed.

+1 −8
Original line number Diff line number Diff line
@@ -425,13 +425,6 @@ class IvasModeCollector(IvasBaseClass.IvasBaseClass):
            self.logger.info("Adding items to mode {}...".format(mode))
            in_config = self.flat_mode_list[mode]["cmd"]["in_config"]

            # hack to handle group B SBA bitrates
            if in_config == "SBA" and any(
                str(br) in mode for br in constants.SPAR_BITRATES
            ):
                # group B SBA takes FOA only
                in_dir = self.in_dirs["FOA"]
            else:
            in_dir = self.in_dirs[in_config]
            in_files = []

+0 −67
Original line number Diff line number Diff line
@@ -49,68 +49,6 @@ from pyaudio3dtools.spatialaudioformat import Format as spformat
import pyaudio3dtools.audiofile as af
import pyaudio3dtools.audioarray as ar
BW_TO_SR = {"nb": 8, "wb": 16, "swb": 32, "fb": 48}
IN_CONFIG_TO_COPY_AUDIO = {
    "SBA": [],
    "HOA3": [],
    "MASA": [],
    "ISM": [],
    "MONO": ["--chanA=A"],
    "STEREO": ["--chanA=A", "--chanB=B"],
    "5_1": [
        "--chanA=A",
        "--chanB=B",
        "--chanC=C",
        "--chanD=D",
        "--chanE=E",
        "--chanF=F",
    ],
    "7_1": [
        "--chanA=A",
        "--chanB=B",
        "--chanC=C",
        "--chanD=D",
        "--chanE=E",
        "--chanF=F",
        "--chanG=G",
        "--chanH=H",
    ],
    "5_1_2": [
        "--chanA=A",
        "--chanB=B",
        "--chanC=C",
        "--chanD=D",
        "--chanE=E",
        "--chanF=F",
        "--chanG=G",
        "--chanH=H",
    ],
    "5_1_4": [
        "--chanA=A",
        "--chanB=B",
        "--chanC=C",
        "--chanD=D",
        "--chanE=E",
        "--chanF=F",
        "--chanG=G",
        "--chanH=H",
        "--chanI=I",
        "--chanJ=J",
    ],
    "7_1_4": [
        "--chanA=A",
        "--chanB=B",
        "--chanC=C",
        "--chanD=D",
        "--chanE=E",
        "--chanF=F",
        "--chanG=G",
        "--chanH=H",
        "--chanI=I",
        "--chanJ=J",
        "--chanK=K",
        "--chanL=L",
    ],
}


class Error(Exception):
@@ -631,11 +569,6 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector):
                        af.convertfile(resamp_in_path, pcm_name_transformed, in_fs=fs, out_fs=out_fs)

                        in_config = config["cmd"]["in_config"].upper()
                        chn_arg = []
                        if in_config in IN_CONFIG_TO_COPY_AUDIO:
                            chn_arg = IN_CONFIG_TO_COPY_AUDIO[
                                config["cmd"]["in_config"].upper()
                            ]

                        pcm_log.flush()
                        pcm_log.close()