Loading .gitignore +3 −0 Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ binary/ tests/**/[c|d]ut tests/**/ref tests/*/testv tests/hrtf_binary_loading/bitstream/* tests/hrtf_binary_loading/dec_out_*/* scripts/testv/*_cut*.pcm scripts/testv/*_cut*.wav scripts/testv/stvOMASA_*.met scripts/testv/stvOMASA_*.csv scripts/testv/stvOMASA_2ISM_1MASA1TC48c.wav Loading .gitlab-ci.yml +202 −71 Original line number Diff line number Diff line Loading @@ -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: Loading Loading @@ -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: Loading Loading @@ -182,6 +188,20 @@ 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 stage: test needs: ["build-codec-sanitizers-linux"] 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 # --------------------------------------------------------------- Loading @@ -203,6 +223,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: Loading Loading @@ -249,6 +271,37 @@ stages: - python3 scripts/prepare_combined_format_inputs.py - cp -r scripts/testv/* $TESTV_DIR/ .sanitizer-selftest-on-mr: 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: 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 # --------------------------------------------------------------- Loading Loading @@ -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 # --------------------------------------------------------------- Loading Loading @@ -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: Loading Loading @@ -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 Loading Loading @@ -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 Loading apps/decoder.c +98 −1 Original line number Diff line number Diff line Loading @@ -2334,7 +2334,11 @@ static ivas_error decodeG192( { if ( ( error = TsmScaleFileReader_readScale( tsmScaleFileReader, &scale ) ) != IVAS_ERR_OK ) { #ifdef FIX_699_FILE_READER_JBM_TSM fprintf( stderr, "\nError (%s) when reading TSM data from %s \n\n", arg.inputBitstreamFilename, TsmScaleFileReader_getFilePath( tsmScaleFileReader ) ); #else fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); #endif goto cleanup; } int16_t maxScaling; Loading Loading @@ -2426,7 +2430,6 @@ static ivas_error decodeG192( #endif } } } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK ); if ( error == IVAS_ERR_END_OF_FILE ) Loading Loading @@ -3422,7 +3425,14 @@ static ivas_error decodeVoIP( } vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; frame++; #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE if ( vec_pos_update == 0 ) { systemTime_ms += vec_pos_len * systemTimeInc_ms; } #else systemTime_ms += systemTimeInc_ms; #endif #ifdef WMOPS update_mem(); Loading @@ -3430,6 +3440,93 @@ static ivas_error decodeVoIP( #endif } #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t nSamplesFlushed = 0; /* decode and get samples */ #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( nSamplesFlushed ) { /* Write current frame */ if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nOutput audio file writer error\n" ); goto cleanup; } /* Write ISm metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM ) { if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } for ( i = 0; i < numObj; ++i ) { IVAS_ISM_METADATA IsmMetadata; if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) ); goto cleanup; } } } if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; /* delayNumSamples is zeroed, and delayNumSamples_orig is updated only on first good frame, so need to re-fetch delay info */ if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; } } } } #endif /*------------------------------------------------------------------------------------------* * Add zeros at the end to have equal length of synthesized signals *------------------------------------------------------------------------------------------*/ Loading apps/encoder.c +4 −0 Original line number Diff line number Diff line Loading @@ -686,7 +686,11 @@ int main( { if ( ( error = JbmFileReader_readCAconfig( jbmReader, &caConfig ) ) != IVAS_ERR_OK ) { #ifdef FIX_699_FILE_READER_JBM_TSM fprintf( stderr, "\nError (%s) while reading Channel-Aware Config. from: %s\n\n", IVAS_ENC_GetErrorMessage( error ), JbmFileReader_getFilePath( jbmReader ) ); #else fprintf( stderr, "JbmFileReader_readCAconfig() failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); #endif goto cleanup; } Loading ci/collect_artifacts.py +16 −31 Original line number Diff line number Diff line Loading @@ -14,39 +14,20 @@ def main(args): collect_for_sanitizer_test(file) def find_failed_files_for_sanitizer_test( console_log: list, subfolder: str, which="LOGS" ) -> dict(): def find_failed_files_for_sanitizer_test(console_log: list) -> dict(): assert which in ["LOGS", "FILE_BASENAMES"] pattern_line = "(Encoding|Decoding) failed .*for \/.*(CLANG.|VALGRIND)\/(.*)" pattern_file = "(.*_b[0-9]*_.*_rs|.*_b[0-9]*_.*_cbr).*" pattern_line = r"(CLANG.) reports . error\(s\) for (.*)" files_found = dict() for line in console_log: m_line = re.match(pattern_line, line) if m_line is not None: _, test, filename = m_line.groups() filename = pathlib.Path(filename).name m_file = re.match(pattern_file, filename) if m_file is None: print(f"Unexpected: no match on {filename} with {pattern_file} - skip") continue filename_start = m_file.groups()[0] if which == "LOGS": folder = pathlib.Path(f"{test}/{subfolder}/") files = [ f for f in folder.iterdir() if f.name.startswith(filename_start) ] elif which == "FILE_BASENAMES": files = [filename_start] test, filename = m_line.groups() if test in files_found: files_found[test].extend(files) files_found[test].append(filename) else: files_found[test] = files files_found[test] = [filename] return files_found Loading @@ -56,16 +37,20 @@ def collect_for_sanitizer_test(file): with open(file) as f: console_log = f.readlines() files_to_archive_noPLC = find_failed_files_for_sanitizer_test( console_log, "logs_noPLC" ) files_to_archive = find_failed_files_for_sanitizer_test(console_log, "logs") start_indicators = ["Adding config" in l for l in console_log] idx_first_run = start_indicators.index(True) idx_second_run = start_indicators[idx_first_run + 1:].index(True) + idx_first_run + 1 no_plc_part = console_log[idx_first_run:idx_second_run] plc_part = console_log[idx_second_run:] files_to_archive_noPLC = find_failed_files_for_sanitizer_test(no_plc_part) files_to_archive_PLC = find_failed_files_for_sanitizer_test(plc_part) log_folder = pathlib.Path("./LOGS_PLC") log_folder.mkdir() for test in files_to_archive.keys(): for test in files_to_archive_PLC.keys(): log_folder.joinpath(test).mkdir() for test, files in files_to_archive.items(): for test, files in files_to_archive_PLC.items(): folder = log_folder.joinpath(test) for p in files: source = pathlib.Path(p) Loading @@ -79,7 +64,7 @@ def collect_for_sanitizer_test(file): for test, files in files_to_archive_noPLC.items(): folder = log_folder_noPLC.joinpath(test) for p in files: source = pathlib.Path(p) source = pathlib.Path(p.replace("/logs/", "/logs_noPLC/")) target = folder.joinpath(source.name) source.rename(target) Loading Loading
.gitignore +3 −0 Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ binary/ tests/**/[c|d]ut tests/**/ref tests/*/testv tests/hrtf_binary_loading/bitstream/* tests/hrtf_binary_loading/dec_out_*/* scripts/testv/*_cut*.pcm scripts/testv/*_cut*.wav scripts/testv/stvOMASA_*.met scripts/testv/stvOMASA_*.csv scripts/testv/stvOMASA_2ISM_1MASA1TC48c.wav Loading
.gitlab-ci.yml +202 −71 Original line number Diff line number Diff line Loading @@ -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: Loading Loading @@ -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: Loading Loading @@ -182,6 +188,20 @@ 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 stage: test needs: ["build-codec-sanitizers-linux"] 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 # --------------------------------------------------------------- Loading @@ -203,6 +223,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: Loading Loading @@ -249,6 +271,37 @@ stages: - python3 scripts/prepare_combined_format_inputs.py - cp -r scripts/testv/* $TESTV_DIR/ .sanitizer-selftest-on-mr: 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: 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 # --------------------------------------------------------------- Loading Loading @@ -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 # --------------------------------------------------------------- Loading Loading @@ -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: Loading Loading @@ -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 Loading Loading @@ -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 Loading
apps/decoder.c +98 −1 Original line number Diff line number Diff line Loading @@ -2334,7 +2334,11 @@ static ivas_error decodeG192( { if ( ( error = TsmScaleFileReader_readScale( tsmScaleFileReader, &scale ) ) != IVAS_ERR_OK ) { #ifdef FIX_699_FILE_READER_JBM_TSM fprintf( stderr, "\nError (%s) when reading TSM data from %s \n\n", arg.inputBitstreamFilename, TsmScaleFileReader_getFilePath( tsmScaleFileReader ) ); #else fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); #endif goto cleanup; } int16_t maxScaling; Loading Loading @@ -2426,7 +2430,6 @@ static ivas_error decodeG192( #endif } } } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK ); if ( error == IVAS_ERR_END_OF_FILE ) Loading Loading @@ -3422,7 +3425,14 @@ static ivas_error decodeVoIP( } vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; frame++; #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE if ( vec_pos_update == 0 ) { systemTime_ms += vec_pos_len * systemTimeInc_ms; } #else systemTime_ms += systemTimeInc_ms; #endif #ifdef WMOPS update_mem(); Loading @@ -3430,6 +3440,93 @@ static ivas_error decodeVoIP( #endif } #ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t nSamplesFlushed = 0; /* decode and get samples */ #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( nSamplesFlushed ) { /* Write current frame */ if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nOutput audio file writer error\n" ); goto cleanup; } /* Write ISm metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM ) { if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } for ( i = 0; i < numObj; ++i ) { IVAS_ISM_METADATA IsmMetadata; if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) ); goto cleanup; } } } if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; /* delayNumSamples is zeroed, and delayNumSamples_orig is updated only on first good frame, so need to re-fetch delay info */ if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } #endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } #ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) #else if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; } } } } #endif /*------------------------------------------------------------------------------------------* * Add zeros at the end to have equal length of synthesized signals *------------------------------------------------------------------------------------------*/ Loading
apps/encoder.c +4 −0 Original line number Diff line number Diff line Loading @@ -686,7 +686,11 @@ int main( { if ( ( error = JbmFileReader_readCAconfig( jbmReader, &caConfig ) ) != IVAS_ERR_OK ) { #ifdef FIX_699_FILE_READER_JBM_TSM fprintf( stderr, "\nError (%s) while reading Channel-Aware Config. from: %s\n\n", IVAS_ENC_GetErrorMessage( error ), JbmFileReader_getFilePath( jbmReader ) ); #else fprintf( stderr, "JbmFileReader_readCAconfig() failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); #endif goto cleanup; } Loading
ci/collect_artifacts.py +16 −31 Original line number Diff line number Diff line Loading @@ -14,39 +14,20 @@ def main(args): collect_for_sanitizer_test(file) def find_failed_files_for_sanitizer_test( console_log: list, subfolder: str, which="LOGS" ) -> dict(): def find_failed_files_for_sanitizer_test(console_log: list) -> dict(): assert which in ["LOGS", "FILE_BASENAMES"] pattern_line = "(Encoding|Decoding) failed .*for \/.*(CLANG.|VALGRIND)\/(.*)" pattern_file = "(.*_b[0-9]*_.*_rs|.*_b[0-9]*_.*_cbr).*" pattern_line = r"(CLANG.) reports . error\(s\) for (.*)" files_found = dict() for line in console_log: m_line = re.match(pattern_line, line) if m_line is not None: _, test, filename = m_line.groups() filename = pathlib.Path(filename).name m_file = re.match(pattern_file, filename) if m_file is None: print(f"Unexpected: no match on {filename} with {pattern_file} - skip") continue filename_start = m_file.groups()[0] if which == "LOGS": folder = pathlib.Path(f"{test}/{subfolder}/") files = [ f for f in folder.iterdir() if f.name.startswith(filename_start) ] elif which == "FILE_BASENAMES": files = [filename_start] test, filename = m_line.groups() if test in files_found: files_found[test].extend(files) files_found[test].append(filename) else: files_found[test] = files files_found[test] = [filename] return files_found Loading @@ -56,16 +37,20 @@ def collect_for_sanitizer_test(file): with open(file) as f: console_log = f.readlines() files_to_archive_noPLC = find_failed_files_for_sanitizer_test( console_log, "logs_noPLC" ) files_to_archive = find_failed_files_for_sanitizer_test(console_log, "logs") start_indicators = ["Adding config" in l for l in console_log] idx_first_run = start_indicators.index(True) idx_second_run = start_indicators[idx_first_run + 1:].index(True) + idx_first_run + 1 no_plc_part = console_log[idx_first_run:idx_second_run] plc_part = console_log[idx_second_run:] files_to_archive_noPLC = find_failed_files_for_sanitizer_test(no_plc_part) files_to_archive_PLC = find_failed_files_for_sanitizer_test(plc_part) log_folder = pathlib.Path("./LOGS_PLC") log_folder.mkdir() for test in files_to_archive.keys(): for test in files_to_archive_PLC.keys(): log_folder.joinpath(test).mkdir() for test, files in files_to_archive.items(): for test, files in files_to_archive_PLC.items(): folder = log_folder.joinpath(test) for p in files: source = pathlib.Path(p) Loading @@ -79,7 +64,7 @@ def collect_for_sanitizer_test(file): for test, files in files_to_archive_noPLC.items(): folder = log_folder_noPLC.joinpath(test) for p in files: source = pathlib.Path(p) source = pathlib.Path(p.replace("/logs/", "/logs_noPLC/")) target = folder.joinpath(source.name) source.rename(target) Loading