Commit 3ffb60e3 authored by vaclav's avatar vaclav
Browse files

Merge branch 'main' of https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec into my_maintenance

# Conflicts:
#	scripts/testv/stv16c.pcm
#	scripts/testv/stv16n.pcm
#	scripts/testv/stv1ISM48s.pcm
#	scripts/testv/stv2ISM48s.pcm
#	scripts/testv/stv2OA32c.pcm
#	scripts/testv/stv2OA48c.pcm
#	scripts/testv/stv32c.pcm
#	scripts/testv/stv32n.pcm
#	scripts/testv/stv3ISM48s.pcm
#	scripts/testv/stv3OA32c.pcm
#	scripts/testv/stv3OA48c.pcm
#	scripts/testv/stv48c.pcm
#	scripts/testv/stv4ISM48s.pcm
#	scripts/testv/stv512MC48c.pcm
#	scripts/testv/stv51MC48c.pcm
#	scripts/testv/stv714MC48c.pcm
#	scripts/testv/stv8c.pcm
#	scripts/testv/stv8n.pcm
#	scripts/testv/stvFOA16c.pcm
#	scripts/testv/stvFOA32c.pcm
#	scripts/testv/stvFOA48c.pcm
#	scripts/testv/stvST16c.pcm
#	scripts/testv/stvST16n.pcm
#	scripts/testv/stvST32c.pcm
#	scripts/testv/stvST32n.pcm
#	scripts/testv/stvST48c.pcm
#	scripts/testv/stvST48n.pcm
#	scripts/testv/stv_IVASMASA_1dir1TC.pcm
#	scripts/testv/stv_IVASMASA_1dir1TC_DTX.pcm
#	scripts/testv/stv_IVASMASA_1dir2TC.pcm
#	scripts/testv/stv_IVASMASA_1dir2TC_DTX.pcm
#	scripts/testv/stv_IVASMASA_2dir1TC.pcm
#	scripts/testv/stv_IVASMASA_2dir2TC.pcm
parents d4474e2c 050f3c0c
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+52 −0
Original line number Diff line number Diff line
# .gitignore for IVAS public collaboration Git repository

# Compiler output Unix
IVAS_cod
IVAS_dec
obj/
*.a
*.o
*.P

# default CMake
build/**/*

# Compiler output VS2017
IVAS_cod.exe
IVAS_dec.exe
*.user
.vs/
Debug_*/
Release_*/
*.obj
*.pdb

# Unittests
scripts/ivas_pytests/tests/unit_tests/crend/IVAS_crend_unit_test
scripts/ivas_pytests/tests/unit_tests/crend/IVAS_crend_unit_test.exe
scripts/ivas_pytests/tests/unit_tests/crend/Debug_*/
scripts/ivas_pytests/tests/unit_tests/crend/Release_*/

# Standalone TD object renderer
scripts/td_object_renderer/object_renderer_standalone/renderer_standalone
scripts/td_object_renderer/object_renderer_standalone/renderer_standalone.exe

# Prerenderer
scripts/prerenderer/IVAS_prerenderer
scripts/prerenderer/IVAS_prerenderer.exe

# General/scripts
.DS_Store
.vscode
*.log
*.bak
scripts/c-code_instrument/
scripts/ifdef_instrument.list
scripts/ref/
scripts/test/
scripts/self_test_summary.txt

# Python files that pop up when running scripts
__pycache__/
*.py[cod]
*$py.class

.gitlab-ci-custom.yml

0 → 100644
+4 −0
Original line number Diff line number Diff line
include:
  - project: $CUSTOM_CI_PROJECT
    ref: $CUSTOM_CI_REF
    file: $CUSTOM_CI_FILE

.gitlab-ci.yml

0 → 100644
+169 −0
Original line number Diff line number Diff line
variables:
  TESTV_DIR: "/usr/local/testv"


# prevent running two pipelines on pushes to merge request branches
workflow:
  rules:
    # see https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
      when: never
    - when: always


stages:
  - maintenance
  - build
  - test
  - compare


# template for all test jobs
.test-job:
  rules:
    - if: $MIRROR_ACCESS_TOKEN # Don't run in the mirror update pipeline (only then MIRROR_ACCESS_TOKEN is defined)
      when: never
    - when: on_success

# template test job on linux
.test-job-linux:
  extends: .test-job
  tags:
    - ivas-linux
  before_script:
    - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi
    - cp -r scripts/testv/* $TESTV_DIR/


# build all components of the project, i.e. codec itself, the unittests, the prerenderer and the standalone version of the TD object renderer
build-all-linux-make:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: build
  script:
    - bash ci/build_all_linux.sh

build-codec-linux-cmake:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: build
  script:
    - mkdir build
    - cd build
    - cmake ..
    - make -j

build-codec-instrumented-linux:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: build
  script:
    - bash ci/build_codec_instrumented_linux.sh

# make sure that the codec builds with msan, asan and usan
build-codec-sanitizers-linux:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: build
  script:
    - bash ci/build_codec_sanitizers_linux.sh


# test that runs all modes with 1s input signals
codec-smoke-test:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: test
  script:
    - bash ci/smoke_test.sh
  artifacts:
    paths:
      - out/logs


# compare bit exactness between target and source branch
self-test-on-merge-request:
  extends: .test-job-linux
  stage: compare
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  script:
    ### build test binaries, initial clean for paranoia reasons
    - make clean
    - mkdir build
    - cd build
    - cmake ..
    - make -j
    - mv IVAS_cod ../IVAS_cod_test
    - mv IVAS_dec ../IVAS_dec_test
    - cd ..
    - rm -rf build/*

    ### backup testvectors from source branch before switching to arget branch -> makes sure that up-to-date testv folder is used in case the branch makes changes to it
    - cp -r scripts/testv scripts/testv.bak

    ### checkout version to compare against
    # first delete local target branch to avoid conflicts when branch is cached and there are merge conflicts during fetching
    # depending on chaching, the branch may not be there, so prevent failure of this command -> should maybe be done smarter later
    - git branch -D $CI_MERGE_REQUEST_TARGET_BRANCH_NAME || true
    # needed when depth is lower than the number of commits in the branch
    - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME

    ### compare to last target branch commit before pipeline was created
    - target_commit=$(git log $CI_MERGE_REQUEST_TARGET_BRANCH_NAME -1 --oneline --before=${CI_PIPELINE_CREATED_AT} --format=%H)
    - git checkout $target_commit

    ### build reference binaries
    - cd build
    - cmake ..
    - make -j
    - mv IVAS_cod ../IVAS_cod_ref
    - mv IVAS_dec ../IVAS_dec_ref
    - cd ..

    # TODO: instead check out the source commit again
    ### restore testv folder from branch
    - rm -rf scripts/testv
    - cp -r scripts/testv.bak scripts/testv

    ### run selftest
    - ls -altr scripts/testv
    - python3 ./scripts/self_test.py --encref IVAS_cod_ref --decref IVAS_dec_ref --enctest IVAS_cod_test --dectest IVAS_dec_test | tee test_output.txt

    ### analyse test output
    # check for crashes during the test, if any happened, fail the test
    - if cat test_output.txt | grep -c "Run errors were encountered for the following conditions:"; then echo "Codec had run errors"; exit 1; fi
    # check for non bitexact output and fail test if the merge request does not have a non-BE tag
    - if ! cat test_output.txt | grep -c "All [0-9]* tests are bitexact" && ! echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]"; then echo "Non-bitexact cases without non-BE tag encountered"; exit 1; fi
  artifacts:
    paths:
      - test_output.txt
      - scripts/test/logs
      - scripts/ref/logs


# Pull state of a branch on 3GPP repo, push to a mirror repo.
pull-from-3gpp-forge:
  stage: maintenance
  rules:
    - if: $MIRROR_ACCESS_TOKEN # Only run in the mirror update pipeline (only then MIRROR_ACCESS_TOKEN is defined)
  script:
    # Set up git LFS for mirroring (see: https://github.com/git-lfs/git-lfs/issues/1762)
    - git lfs install --skip-smudge --local
    
    # Check out mirror branch - by default the runner checks out by commit hash, which results in detached head state
    - git checkout $CI_COMMIT_BRANCH
    
    # Pull commits from upstream
    - git remote add upstream https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec.git
    - git pull --ff-only --tags upstream $MIRROR_SOURCE_BRANCH
    - git lfs pull upstream

    # Push to mirror, include tags. Option `-o ci.skip` tells GitLab to skip CI for the pushed commits (assumed already tested upstream)
    - git push --tags -o ci.skip "https://${GITLAB_USER_LOGIN}:${MIRROR_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_BRANCH}"

ci/build_all_linux.sh

0 → 100755
+18 −0
Original line number Diff line number Diff line
#! /usr/bin/bash

if [ ! -d "lib_com" ]; then
    echo "not in root directory! - please run in IVAS root"
    exit 1
fi

# first build codec, everything else needs this anyway
make clean all
# build unittests
make unittests
# build prerenderer
cd scripts/prerenderer
make
# build standalone TD object renderer
cd ..
cd td_object_renderer/object_renderer_standalone
make
+11 −0
Original line number Diff line number Diff line
#! /usr/bin/bash

if [ ! -d "lib_com" ]; then
    echo "not in root directory! - please run in IVAS root"
    exit 1
fi

cd scripts
./prepare_instrumentation.sh
cd c-code_instrument
make
Loading