Commit bc2aaabf authored by multrus's avatar multrus
Browse files

Merge branch 'main' into 20240320_cleanup

parents 1ea7e994 54f2f9de
Loading
Loading
Loading
Loading
Loading
+35 −7
Original line number Diff line number Diff line
@@ -201,7 +201,23 @@ stages:
    - 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
    - export UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1

    - exit_code20=0
    - exit_code10=0
    - exit_code5=0

    - if [ $CLANG_NUM -eq 1 ]; then sanitizer_type="MemorySanitizer"; elif [ $CLANG_NUM -eq 2 ]; then sanitizer_type="AddressSanitizer"; elif [ $CLANG_NUM -eq 3 ]; then sanitizer_type="UndefinedBehaviorSanitizer"; else echo "Wrong CLANG_NUM $CLANG_NUM given!"; exit 1; fi

    # run encoder and decoder with 20ms renderer framesize first, use reference creation mode
    - python3 -m pytest $SELF_TEST_PRM_FILE -v --update_ref 1 -m create_ref --html=report-20ms.html --self-contained-html --junit-xml=report-junit-20ms.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code20=$?
    # for 10ms and 5ms renderer framesize, we only need to run the decoder part as renderer framesize is a decoder-only option
    # set tolerance very high do ignore any BE differences due to the different renderer framesizes, those can appear due to the limiter being active
    # we are only interested in runtime errors from the sanitizers and ignore the diffs
    - python3 -m pytest $SELF_TEST_PRM_FILE -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 --decoder_only --abs_tol 100000 || exit_code5=$?
    - python3 -m pytest $SELF_TEST_PRM_FILE -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 --decoder_only --abs_tol 100000 || exit_code10=$?

    - if [ $exit_code20 -ne 0 ] || [ $exit_code10 -ne 0 ] || [ $exit_code5 -ne 0 ]; then exit 1; fi


# ---------------------------------------------------------------
@@ -283,12 +299,18 @@ stages:
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
      - report-junit-20ms.xml
      - report-junit-10ms.xml
      - report-junit-5ms.xml
      - report-20ms.html
      - report-10ms.html
      - report-5ms.html
    expose_as: "Sanitizer selftest results"
    reports:
      junit:
        - report-junit.xml
        - report-junit-20ms.xml
        - report-junit-10ms.xml
        - report-junit-5ms.xml

.sanitizer-selftest-ltv:
  stage: test
@@ -299,12 +321,18 @@ stages:
    expire_in: 2 week
    when: always
    paths:
      - report-junit.xml
      - report.html
      - report-junit-20ms.xml
      - report-junit-10ms.xml
      - report-junit-5ms.xml
      - report-20ms.html
      - report-10ms.html
      - report-5ms.html
    expose_as: "Sanitizer selftest results"
    reports:
      junit:
        - report-junit.xml
        - report-junit-20ms.xml
        - report-junit-10ms.xml
        - report-junit-5ms.xml

# ---------------------------------------------------------------
# .pre jobs for setting up things
+5 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ import pyaudio3dtools
import pyivastest


def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0) -> (int, str):
def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) -> (int, str):
    """
    Compare 2 PCM files for bitexactness
    """
@@ -49,10 +49,13 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0) -> (int, str
        s1, s2, fs, per_frame=False, get_mld=get_mld
    )


    output_differs = 0
    reason = "SUCCESS: Files are bitexact"

    if not cmp_result["bitexact"]:
    if not cmp_result["bitexact"] and cmp_result["max_abs_diff"] <= abs_tol:
        reason = "SUCCESS: Maximum absolute diff below threshold"
    elif not cmp_result["bitexact"]:
        diff_msg = f"MAXIMUM ABS DIFF ==> {cmp_result['max_abs_diff']} at sample num {cmp_result['max_abs_diff_pos_sample']} (assuming {nchannels} channels)"
        first_msg = f"First diff found at sample num {cmp_result['first_diff_pos_sample']} in channel {cmp_result['first_diff_pos_channel']}, frame {cmp_result['first_diff_pos_frame']} (assuming {nchannels} channels, {fs} sampling rate)"
        print(diff_msg)
+3 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ def test_masa_enc_dec(
    get_mld,
    get_mld_lim,
    decoder_only,
    abs_tol,
):
    # Input parameters
    in_fs = 48
@@ -217,6 +218,7 @@ def test_masa_enc_dec(
                int(out_fs * 1000),
                get_mld=get_mld,
                mld_lim=get_mld_lim,
                abs_tol=abs_tol,
            )
            if get_mld:
                mld = re.search(MLD_PATTERN, reason).groups(1)[0]
@@ -253,6 +255,7 @@ def test_masa_enc_dec(
                    int(out_fs * 1000),
                    get_mld=get_mld,
                    mld_lim=get_mld_lim,
                    abs_tol=abs_tol,
                )
                if get_mld:
                    mld = re.search(MLD_PATTERN, reason).groups(1)[0]
+2 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ def test_param_file_tests(
    test_tag,
    get_mld,
    get_mld_lim,
    abs_tol,
):
    enc_opts, dec_opts, sim_opts, eid_opts = param_file_test_dict[test_tag]

@@ -340,6 +341,7 @@ def test_param_file_tests(
            fs,
            get_mld=get_mld,
            mld_lim=get_mld_lim,
            abs_tol=abs_tol,
        )
        md_out_files = get_expected_md_files(ref_output_file, enc_split, output_config)

+4 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ def test_sba_plc_system(
    gain_flag,
    get_mld,
    get_mld_lim,
    abs_tol,
):
    SID = 0
    if dtx == "1" and ivas_br not in ["13200", "16400", "24400", "32000", "64000"]:
@@ -130,6 +131,7 @@ def test_sba_plc_system(
        keep_files,
        get_mld=get_mld,
        get_mld_lim=get_mld_lim,
        abs_tol=abs_tol,
    )


@@ -153,6 +155,7 @@ def sba_dec_plc(
    keep_files,
    get_mld=False,
    get_mld_lim=0,
    abs_tol=0,
):
    # ------------  run cmd  ------------

@@ -209,6 +212,7 @@ def sba_dec_plc(
            fs,
            get_mld=get_mld,
            mld_lim=get_mld_lim,
            abs_tol=abs_tol,
        )
        if get_mld:
            mld = re.search(MLD_PATTERN, reason).groups(1)[0]
Loading