Commit 47092556 authored by vasilache's avatar vasilache
Browse files

Merge branch 'main' into...

Merge branch 'main' into 1004-usan-implicit-conversion-from-signed-to-unsigned-integer-changes-value-in-ivas_masa_dec-c
parents 00d1268d b7be58e4
Loading
Loading
Loading
Loading
Loading
+202 −71
Original line number Diff line number Diff line
@@ -20,7 +20,10 @@ variables:
      - 'default'
      - 'test-be-release'
      - 'test-long-self-test'
      - 'ivas-conformance'
  GIT_CLEAN_FLAGS: -ffdxq
  TESTCASE_TIMEOUT_STV_SANITIZERS: 180
  TESTCASE_TIMEOUT_LTV_SANITIZERS: 1200


default:
@@ -51,6 +54,9 @@ workflow:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test'
      variables:
        IVAS_PIPELINE_NAME: 'Test long self-test against main pipeline: $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
      variables:
        IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test: $CI_COMMIT_BRANCH'        
    - if: $CI_PIPELINE_SOURCE == 'trigger'

stages:
@@ -182,6 +188,18 @@ stages:
  - (Get-Content -Path "CMakeLists.txt") -replace '# \(add_compile_options\("\/WX"\)\)', '$1' | Set-Content -Path "CMakeLists.txt"
  - Get-ChildItem -Path "Workspace_msvc" -Filter "*.vcxproj" | ForEach-Object { (Get-Content -Path $_.FullName) -replace '<TreatWarningAsError>false', '<TreatWarningAsError>true' | Set-Content -Path $_.FullName }

# to be reused in MR and LTV-scheduled sanitizer test jobs
# set CLANG_NUM, SELFTEST_SANITY_TIMEOUT and SELF_TEST_PRM_FILE in before_script section
.sanitizer-selftest-anchor: &sanitizer-selftest-anchor
  script:
    - *print-common-info
    - *copy-ltv-files-to-testv-dir
    - make clean
    - make -j CLANG=$CLANG_NUM
    - testcase_timeout=$SELFTEST_SANITY_TIMEOUT
    - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 -m pytest $SELF_TEST_PRM_FILE -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec


# ---------------------------------------------------------------
# Job templates
# ---------------------------------------------------------------
@@ -203,6 +221,8 @@ stages:
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'test-long-self-test' # Skip all the normal jobs when testing manually against release codec
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
      when: never      
    - when: on_success

.rules-merge-request:
@@ -249,6 +269,39 @@ stages:
    - python3 scripts/prepare_combined_format_inputs.py
    - cp -r scripts/testv/* $TESTV_DIR/

.sanitizer-selftest-on-mr:
  stage: test
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
    expose_as: "Sanitizer selftest results"
    reports:
      junit:
        - report-junit.xml

.sanitizer-selftest-ltv:
  stage: test
  extends:
    - .test-job-linux-needs-testv-dir
  artifacts:
    name: "$CI_JOB_NAME--sha-$CI_COMMIT_SHORT_SHA--results"
    expire_in: 2 week
    when: always
    paths:
      - report-junit.xml
      - report.html
    expose_as: "Sanitizer selftest results"
    reports:
      junit:
        - report-junit.xml

# ---------------------------------------------------------------
# .pre jobs for setting up things
# ---------------------------------------------------------------
@@ -399,7 +452,7 @@ build-codec-windows-msbuild:
  script:
    - *print-common-info-windows
    - *activate-WX-windows
    - py .\scripts\strip_split_rendering.py
    - python .\scripts\strip_split_rendering.py
    - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug

# ---------------------------------------------------------------
@@ -443,83 +496,32 @@ codec-smoke-test:
# code selftest testvectors with memory-sanitizer binaries
codec-msan:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  stage: test
  needs: ["build-codec-sanitizers-linux"]
  script:
    - *print-common-info
    - make clean
    - make -j CLANG=1
    - testcase_timeout=180
    - exit_code=0
    - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$?
    - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang memory-sanitizer"; exit 1; fi
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
    expose_as: "msan selftest results"
    reports:
      junit:
        - report-junit.xml
    - .sanitizer-selftest-on-mr
  before_script:
    - CLANG_NUM=1
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS
    - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py"
  <<: *sanitizer-selftest-anchor

# code selftest testvectors with address-sanitizer binaries
codec-asan:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  stage: test
  needs: ["build-codec-sanitizers-linux"]
  script:
    - *print-common-info
    - make clean
    - make -j CLANG=2
    - testcase_timeout=180
    - exit_code=0
    - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$?
    - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang address-sanitizer"; exit 1; fi
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
    expose_as: "asan selftest results"
    reports:
      junit:
        - report-junit.xml
    - .sanitizer-selftest-on-mr
  before_script:
    - CLANG_NUM=2
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS
    - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py"
  <<: *sanitizer-selftest-anchor

# code selftest testvectors with address-sanitizer binaries
# code selftest testvectors with undefined-behaviour-sanitizer binaries
codec-usan:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  stage: test
  needs: ["build-codec-sanitizers-linux"]
  script:
    - *print-common-info
    - make clean
    - make -j CLANG=3
    - testcase_timeout=180
    - exit_code=0
    - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code=$?
    - if [ $exit_code != 0 ] ; then echo "Run errors found by Clang undefined-behavior-sanitizer"; exit 1; fi
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
    expose_as: "usan selftest results"
    reports:
      junit:
        - report-junit.xml
    - .sanitizer-selftest-on-mr
  before_script:
    - CLANG_NUM=3
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS
    - SELF_TEST_PRM_FILE="tests/codec_be_on_mr_nonselection/test_param_file.py"
  <<: *sanitizer-selftest-anchor

# test renderer executable
renderer-smoke-test:
@@ -1215,6 +1217,85 @@ test-be-to-release:
    expose_as: "test-be-to-release results"


ivas-conformance:
  tags:
    - ivas-windows
  stage: test
  timeout: "60 minutes"
  rules:
    - if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
  allow_failure:
    exit_codes:
      - 123
  script:
    - *print-common-info-windows
    # Prepare reference exec, use tests and scripts from reference
    - $source_branch_commit_sha = $(git rev-parse HEAD)
    - git checkout main # This should be set to a relevant reference
    - python .\scripts\strip_split_rendering.py
    - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug    
    - 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
    - git restore .
    - git checkout $source_branch_commit_sha
    
    # Reference creation
    - python tests/create_short_testvectors.py
    - python scripts/prepare_combined_format_inputs.py
    - python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --keep_files
    - python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref_part2 --keep_files
    - python -m pytest tests/renderer/test_renderer.py --create_ref --keep_files

    # Output creation
    - python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
    - python scripts/parse_commands.py report_cmd.html Readme_IVAS.txt
    
    # Copy input data and output ref data
    - if (Test-Path testvec) {rm -r -force testvec}
    - mkdir testvec
    - mkdir testvec/binauralRenderer_interface
    - mkdir testvec/testv
    - mkdir testvec/testv/renderer
    - mkdir testvec/bin    
    - cp -r -force -ErrorAction Ignore scripts/testv/* testvec/testv
    - cp -r -force -ErrorAction Ignore scripts/ls_layouts testvec
    - cp -r -force -ErrorAction Ignore scripts/switchPaths testvec
    - cp -r -force -ErrorAction Ignore scripts/trajectories testvec
    - cp -r -force -ErrorAction Ignore scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface
    - cp -r -force -ErrorAction Ignore tests/ref testvec/testv/ref
    - cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref
    - cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref
    - cp -r -force -ErrorAction Ignore tests/conformance-test testvec/
    - cp Readme_IVAS_dec.txt testvec
    - cp Readme_IVAS_enc.txt testvec 
    - cp Readme_IVAS_rend.txt testvec
    - cp Readme_IVAS_JBM_dec.txt testvec
    - cp IVAS_cod.exe testvec/bin
    - cp IVAS_dec.exe testvec/bin
    - cp IVAS_rend.exe testvec/bin
    
    # Test run generated scripts in testvec
    - cd testvec    
    - python -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html
    - mv report.html ..
    - mv report-junit.xml ..

  artifacts:
    name: "ivas-conformance-$CI_COMMIT_SHORT_SHA"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
      - Readme_IVAS_dec.txt  
      - Readme_IVAS_enc.txt  
      - Readme_IVAS_rend.txt
      - Readme_IVAS_JBM_dec.txt
    expose_as: "Draft IVAS conformance"
    reports:
      junit: report-junit.xml

test-long-self-test:
  tags:
    - ivas-linux-fast
@@ -1289,6 +1370,56 @@ test-long-self-test:
# ---------------------------------------------------------------
# Scheduled jobs on main
# ---------------------------------------------------------------

# code selftest long testvectors with memory-sanitizer binaries
ltv-msan:
  extends:
    - .sanitizer-selftest-ltv
  rules:
    - if: $SANITIZER_SCHEDULE_E
  timeout: 1 hour
  tags:
    - ivas-linux-fast
  before_script:
    - CLANG_NUM=1
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS
    - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py"
  <<: *sanitizer-selftest-anchor

# code selftest long testvectors with address-sanitizer binaries
ltv-asan:
  extends:
    - .sanitizer-selftest-ltv
  rules:
    - if: $SANITIZER_SCHEDULE_E
      when: delayed
      start_in: 1 hours
  tags:
    - ivas-linux-fast
  timeout: 1 hour
  before_script:
    - CLANG_NUM=2
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS
    - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py"
  <<: *sanitizer-selftest-anchor

# code selftest long testvectors with undefined-behaviour-sanitizer binaries
ltv-usan:
  extends:
    - .sanitizer-selftest-ltv
  rules:
    - if: $SANITIZER_SCHEDULE_E
      when: delayed
      start_in: 2 hours
  tags:
    - ivas-linux-fast
  timeout: 1 hour
  before_script:
    - CLANG_NUM=3
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS
    - SELF_TEST_PRM_FILE="tests/test_param_file_ltv.py"
  <<: *sanitizer-selftest-anchor

.sanitizer-test-template:
  extends:
    - .test-job-linux
+39 −0
Original line number Diff line number Diff line
### Basic info

- Commit SHA: 

### Bug description

Clang ASAN sanitizer test in pipeline found an error:

<!--- Copy sanitizer traceback from command line here -->
```

```

<!--- Copy test job URL here -->
Link to test pipeline: XXX

### Ways to reproduce

Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/Software-development/pyivastest-howto#how-to-reproduce-tests):
<!--- check correct sanitizer type -->
<!--- add error pattern if needed -->
```
python3 scripts/IvasBuildAndRunChecks.py --checks CLANG2 -m MODE -p /path/to/my/local/ci_linux_ltv_local.json
```
or directly:

```
make clean
make -j CLANG=2
./IVAS_cod ...
networkSimulator_g192 dly_profile.dat bit bit_err trace_dump 1
./IVAS_dec ...
```

<!--- Below are labels that will be added but are not shown in description. This is a template to help fill them.
      Add further information to the first row and remove and add labels as necessary.  -->

/label ~"Priority::Critical" ~Company: ~Subpart:
/label ~Type:Bug ~Status::ToDo
+46 −0
Original line number Diff line number Diff line
### Basic info

- Commit SHA: 

### Bug description

Clang MSAN sanitizer test in pipeline found an error:

<!--- Copy sanitizer traceback from command line here -->
```

```

<!--- Copy test job URL here -->
Link to test pipeline: XXX

### Ways to reproduce

Activate [origin-tracking](https://clang.llvm.org/docs/MemorySanitizer.html#msan-origins) (more detailed traceback about where the undefined value came from) by appending
```
 -fsanitize-memory-track-origins
```
in the `Makefile` at lines 71 and 72. Note that this may increase runtime heavily.

Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/Software-development/pyivastest-howto#how-to-reproduce-tests):
<!--- check correct sanitizer type -->
<!--- add error pattern if needed -->

```
python3 scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m MODE -p /path/to/my/local/ci_linux_ltv_local.json
```
or directly:

```
make clean
make -j CLANG=1
./IVAS_cod ...
networkSimulator_g192 dly_profile.dat bit bit_err trace_dump 1
./IVAS_dec ...
```

<!--- Below are labels that will be added but are not shown in description. This is a template to help fill them.
      Add further information to the first row and remove and add labels as necessary.  -->

/label ~"Priority::Critical" ~Company: ~Subpart:
/label ~Type:Bug ~Status::ToDo
+4 −4
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

### Bug description

Clang (m,a,u)san sanitizer test in pipeline found an error:
Clang USAN sanitizer test in pipeline found an error:

<!--- Copy sanitizer traceback from command line here -->
```
@@ -20,15 +20,15 @@ Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/
<!--- check correct sanitizer type -->
<!--- add error pattern if needed -->
```
python3 scripts/IvasBuildAndRunChecks.py --checks CLANGX -m MODE -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp
python3 scripts/IvasBuildAndRunChecks.py --checks CLANG3 -m MODE -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp
```
or directly:

```
make clean
make -j CLANG=X
make -j CLANG=3
./IVAS_cod ...
eid-xor -vbr -fer bit ep_015.g192 bit_fer
networkSimulator_g192 dly_profile.dat bit bit_err trace_dump 1
./IVAS_dec ...
```

+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -re
MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"]
AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"]
TIMEOUT = (
    60 * 15
    60 * 20
)  # timeout of 15 minutes per en/decoding to safeguard against endless loops

CONSOLE_OUT_FILE = "output_san.txt"
Loading