From eedf4961e0defee9e9fbc49c44aaec49781beb24 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 28 Nov 2025 14:27:29 +0100 Subject: [PATCH 1/3] first version for testing on runner --- ci/run-first-frame-is-sid-test.sh | 41 +++++++++++----------- scripts/config/ci_linux_sidstart_test.json | 6 ++-- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/ci/run-first-frame-is-sid-test.sh b/ci/run-first-frame-is-sid-test.sh index a6e81f9352..4403b52a73 100755 --- a/ci/run-first-frame-is-sid-test.sh +++ b/ci/run-first-frame-is-sid-test.sh @@ -1,15 +1,19 @@ #! /usr/bin/bash +### This test assures that for all DTX modes, decoding a bitstream that starts with an SID frame does not crash the decoder or cause a sanitizer error + +set -euxo pipefail + # build encoder without sanitizers for faster runtime make clean make -j IVAS_cod mv IVAS_cod IVAS_cod_nosan -# run all modes and cut bitstream to start with an SID. Use mono output to limit runtime, test is only about decoding the first frame -modes_no_sba=$(scripts/runIvasCodec.py -l | grep dtx | grep -vE "stereo|FOA|HOA" ) -modes_hoa=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA") -modes_foa=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA") -modes_stereo=$(scripts/runIvasCodec.py -l | grep dtx | grep "stereo") +# collect DTX modes to run +# stereo modes are run separately from the rest +# reason: the stv signal does not trigger DTX for the highest stereo bitrates. We use the ltv signal cut to a different length than the other signal +modes_no_stereo=$(scripts/runIvasCodec.py -l | grep dtx | grep -v stereo) +modes_stereo=$(scripts/runIvasCodec.py -l | grep dtx | grep stereo) # config vars testcase_timeout=20 @@ -26,13 +30,9 @@ cp IVAS_cod_nosan CLANG1/IVAS_cod exit_code_msan=0 echo "-------------- 1. Encoder + Msan decoder -------------- " -echo "-------------- 1.1 all DTX modes except SBA and stereo -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_no_sba -U 0:20 $common_args || exit_code_msan=$? -echo "-------------- 1.2 HOA2 + HOA3 DTX modes -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_hoa -U 70:80 $common_args || exit_code_msan=$? -echo "-------------- 1.3 FOA DTX modes -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_foa -U 75:110 $common_args || exit_code_msan=$? -echo "-------------- 1.4 stereo DTX modes -------------- " +echo "-------------- 1.1 all DTX modes except stereo -------------- " +scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_no_stereo -U 0:20 $common_args || exit_code_msan=$? +echo "-------------- 1.2 stereo DTX modes -------------- " scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_stereo -U 40:60 $common_args || exit_code_msan=$? # archive encoder logs separately mkdir logs_enc logs_dec_msan @@ -47,15 +47,14 @@ cp -r CLANG1/enc CLANG3/enc exit_code_asan_usan=0 echo "-------------- 2. Asan + Usan decoder -------------- " -echo "-------------- 2.1 all DTX modes except SBA and stereo -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_no_sba -U 0:20 $common_args || exit_code_asan_usan=$? -echo "-------------- 2.2 HOA2 + HOA3 DTX modes -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_hoa -U 70:80 $common_args || exit_code_asan_usan=$? -echo "-------------- 2.3 FOA DTX modes -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_foa -U 75:110 $common_args || exit_code_asan_usan=$? -echo "-------------- 2.4 stereo DTX modes -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_stereo -U 40:60 $common_args || exit_code_asan_usan=$? +echo "-------------- 2.1 all DTX modes except stereo -------------- " +scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_no_stereo $common_args || exit_code_asan_usan=$? +echo "-------------- 2.2 stereo DTX modes -------------- " +scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_stereo $common_args || exit_code_asan_usan=$? mv CLANG2/logs logs_dec_asan mv CLANG3/logs logs_dec_usan -if [ $exit_code_msan -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then echo "There was either a crash or a sanitizer error encountered when decoding a bitstream that starts with an SID. Check the artifacts for the logfiles."; exit 1; fi +if [ $exit_code_msan -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then + echo "There was either a crash or a sanitizer error encountered when decoding a bitstream that starts with an SID. Check the artifacts for the logfiles." + exit 1 +fi diff --git a/scripts/config/ci_linux_sidstart_test.json b/scripts/config/ci_linux_sidstart_test.json index 787efbf82c..10ef6b0281 100644 --- a/scripts/config/ci_linux_sidstart_test.json +++ b/scripts/config/ci_linux_sidstart_test.json @@ -4,9 +4,9 @@ "inpaths": { "MONO": "/usr/local/testv/stv48n.wav", "STEREO": "/usr/local/ltv/ltv48_STEREO.wav", - "FOA": "/usr/local/ltv/ltv48_FOA.wav", - "HOA2": "/usr/local/ltv/ltv48_HOA2.wav", - "HOA3": "/usr/local/ltv/ltv48_HOA3.wav", + "FOA": "/usr/local/testv/stvFOA48n.wav", + "HOA2": "/usr/local/testv/stv2OA48n.wav", + "HOA3": "/usr/local/testv/stv3OA48n.wav", "SBA": "/usr/local/ltv/ltv48_HOA3.wav", "MASA1TC": "/usr/local/ltv/ltv48_MASA1TC.wav", "MASA2TC": "/usr/local/ltv/ltv48_MASA2TC.wav", -- GitLab From 299a9db1ec56cc69838c8eb71b9d90cc99eae477 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 28 Nov 2025 14:45:12 +0100 Subject: [PATCH 2/3] run USAN + ASAN in one go + sanity check for SIDs --- ci/run-first-frame-is-sid-test.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/ci/run-first-frame-is-sid-test.sh b/ci/run-first-frame-is-sid-test.sh index 4403b52a73..192333dd8e 100755 --- a/ci/run-first-frame-is-sid-test.sh +++ b/ci/run-first-frame-is-sid-test.sh @@ -28,33 +28,43 @@ make IVAS_dec -j CLANG=1 cp IVAS_dec CLANG1/IVAS_dec cp IVAS_cod_nosan CLANG1/IVAS_cod -exit_code_msan=0 +exit_code_msan_no_stereo=0 +exit_code_msan_stereo=0 echo "-------------- 1. Encoder + Msan decoder -------------- " echo "-------------- 1.1 all DTX modes except stereo -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_no_stereo -U 0:20 $common_args || exit_code_msan=$? +scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_no_stereo -U 0:20 $common_args || exit_code_msan_no_stereo=$? echo "-------------- 1.2 stereo DTX modes -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_stereo -U 40:60 $common_args || exit_code_msan=$? +scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_stereo -U 40:60 $common_args || exit_code_msan_stereo=$? # archive encoder logs separately mkdir logs_enc logs_dec_msan mv CLANG1/logs/*.enc.txt logs_enc/ mv CLANG1/logs/*.dec*.txt logs_dec_msan/ +# sanity check: ensure that we have DTX frames in the cut bitstreams +grep_result=$(grep -r "Extracted 0 frames!" logs_enc/) +if [ "$grep_result" != "" ]; then + echo "Some bitstreams did not contain any SID frame!" + echo -e "Check the input signals and/or the VAD performance!\n" + echo "$grep_result" + exit 1 +fi + # ASAN and USAN can be done in one go and decoder only # copy encoder output from CLANG1 dir mkdir CLANG2 CLANG3 cp -r CLANG1/enc CLANG2/enc cp -r CLANG1/enc CLANG3/enc +# In this run, we can do all the dtx modes together - we only run the decoder, so no cutting of input files needed +# the script does no put the cut length into the bitstream name, so the decoder can find the existing bitstreams this way +modes_all=$(scripts/runIvasCodec.py -l | grep dtx) exit_code_asan_usan=0 -echo "-------------- 2. Asan + Usan decoder -------------- " -echo "-------------- 2.1 all DTX modes except stereo -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_no_stereo $common_args || exit_code_asan_usan=$? -echo "-------------- 2.2 stereo DTX modes -------------- " -scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_stereo $common_args || exit_code_asan_usan=$? +echo "-------------- 2. Asan + Usan decoder (all in one go) -------------- " +scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_all $common_args || exit_code_asan_usan=$? mv CLANG2/logs logs_dec_asan mv CLANG3/logs logs_dec_usan -if [ $exit_code_msan -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then +if [ $exit_code_msan_no_stereo -ne 0 ] || [ $exit_code_msan_stereo -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then echo "There was either a crash or a sanitizer error encountered when decoding a bitstream that starts with an SID. Check the artifacts for the logfiles." exit 1 fi -- GitLab From ff645a451b8a6029df4792a4b82826798c069d42 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 28 Nov 2025 14:51:54 +0100 Subject: [PATCH 3/3] fix check for greo result --- ci/run-first-frame-is-sid-test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/run-first-frame-is-sid-test.sh b/ci/run-first-frame-is-sid-test.sh index 192333dd8e..8da66f011c 100755 --- a/ci/run-first-frame-is-sid-test.sh +++ b/ci/run-first-frame-is-sid-test.sh @@ -41,8 +41,9 @@ mv CLANG1/logs/*.enc.txt logs_enc/ mv CLANG1/logs/*.dec*.txt logs_dec_msan/ # sanity check: ensure that we have DTX frames in the cut bitstreams -grep_result=$(grep -r "Extracted 0 frames!" logs_enc/) -if [ "$grep_result" != "" ]; then +grep_exit_code=0 +grep -r "Extracted 0 frames!" logs_enc/ || grep_exit_code=$? +if [ $grep_exit_code -ne 1 ]; then echo "Some bitstreams did not contain any SID frame!" echo -e "Check the input signals and/or the VAD performance!\n" echo "$grep_result" -- GitLab