From e0797fe60968548d04d7498326f20a7119787f0f Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Wed, 23 Aug 2023 09:15:46 +0200 Subject: [PATCH 1/5] fix crash when conditions fail - log failed conditions to file - bug fix when running locally with optional argument `-test_dir` --- ci/run_evs_be_win_test.py | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/ci/run_evs_be_win_test.py b/ci/run_evs_be_win_test.py index f1bcd7f3a4..1e3f9c627a 100644 --- a/ci/run_evs_be_win_test.py +++ b/ci/run_evs_be_win_test.py @@ -42,19 +42,24 @@ def run_condition(eval_cmd, diff_cmd, id_count): cmd = subprocess.run(eval_cmd.split(), capture_output=True, text=True, check=True) # diff - diff_success = 1 + diff_fails = '' if ';' in diff_cmd: + # JBM cases diff_cmd1, diff_cmd2 = diff_cmd.split(';') - cmd1 = subprocess.run(diff_cmd1.split(), capture_output=True, text=True, check=True) - cmd2 = subprocess.run(diff_cmd2.split(), capture_output=True, text=True, check=True) - diff_success = cmd1.returncode + cmd2.returncode + cmd1 = subprocess.run(diff_cmd1.split(), stdout=subprocess.DEVNULL, check=False) + cmd2 = subprocess.run(diff_cmd2.split(), stdout=subprocess.DEVNULL, check=False) + if cmd1.returncode != 0: + diff_fails += f'{diff_cmd1}\n' + if cmd2.returncode != 0: + diff_fails += f'{diff_cmd2}\n' else: - cmd = subprocess.run(diff_cmd.split(), capture_output=True, text=True, check=True) - diff_success = cmd.returncode - if diff_success == 0: - return None + cmd = subprocess.run(diff_cmd.split(), stdout=subprocess.DEVNULL, check=False) + if cmd.returncode != 0: + diff_fails += f'{diff_cmd}\n' + if diff_fails: + return diff_fails else: - return f'[{str(id_count).rjust(3)}] FAIL: {" ".join(eval_cmd)}\n {diff_cmd}\n' + return None def environment_is_correct(paths): @@ -116,6 +121,7 @@ if __name__ == '__main__': if os.path.exists(tmp_dir): shutil.rmtree(tmp_dir) os.makedirs(tmp_dir) + line = line.replace('testv', f'{test_vec_dir}/testv') line = line if tmp_dir is None else line.replace( '$TMP/', f'{tmp_dir}/') if '$CUT_DEC_BIN' in line: @@ -127,7 +133,7 @@ if __name__ == '__main__': if '-w' not in line.split()[1]: diff_cmd = 'FC.exe ' + ' '.join(line.split()[1:]).replace('/', '\\').replace('\n', '/n') continue - diff_cmd += '; FC.exe ' + ' '.join(line.split()[1:]).replace('/', '\\').replace('\n', '/n').replace('-w', '/W') + diff_cmd += ';FC.exe ' + ' '.join(line.split()[1:]).replace('/', '\\').replace('\n', '/n').replace('-w', '/W') else: diff_cmd = 'FC.exe ' + ' '.join(line.split()[1:]).replace('/', '\\').replace('\n', '/n') results.append(pool.apply_async( @@ -138,11 +144,11 @@ if __name__ == '__main__': results = [r.get() for r in results if r.get()] if results: - print(f'\n{len(results)} test conditions failed:') - print('\n'.join(results)) + print(f'\n --- {len(results)} test conditions failed ---') + print(''.join(results)) with open('failed.txt', 'w') as f: - print(f'\n{len(results)} test conditions failed:', file=f) - print('\n'.join(results), file=f) + print(f' --- {len(results)} test conditions failed ---', file=f) + print(''.join(results), file=f) sys.exit(1) else: print('\n *** All tests passed! ***') -- GitLab From d69529c45823f18a2d4230fa82d255922a200db5 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Wed, 23 Aug 2023 11:01:49 +0200 Subject: [PATCH 2/5] temporarily move job to Mr pipeline for testing --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 079d8235e7..463237841b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -907,7 +907,7 @@ lc3plus-ensure-no-code-changes: # check bitexactness to EVS windows binaries be-2-evs-windows: extends: - - .rules-main-push + - .rules-merge-request tags: - ivas-windows stage: test -- GitLab From 0d21066c55ea3d2190729d0018a72e450c5d2e97 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Wed, 23 Aug 2023 11:16:33 +0200 Subject: [PATCH 3/5] Revert "temporarily move job to Mr pipeline for testing" This reverts commit d69529c45823f18a2d4230fa82d255922a200db5. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 463237841b..079d8235e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -907,7 +907,7 @@ lc3plus-ensure-no-code-changes: # check bitexactness to EVS windows binaries be-2-evs-windows: extends: - - .rules-merge-request + - .rules-main-push tags: - ivas-windows stage: test -- GitLab From 9ff20d6093480e06406edc8f1f7302a0a76e40a1 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Wed, 23 Aug 2023 12:57:08 +0200 Subject: [PATCH 4/5] temporarily introduce bug to trigger failure case Revert "Fix for limiter deactivation in EVS and AMR-WB IO modes under API_5MS" + run be-2-evs-windows job on MR pipeline - This reverts commit 541d242e628f8e068daf9a338aa0575e2219c567 and moves be-2-evs-windows job to MR pipeline --- .gitlab-ci.yml | 2 +- apps/renderer.c | 4 +++- lib_dec/ivas_jbm_dec.c | 19 +++---------------- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 079d8235e7..463237841b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -907,7 +907,7 @@ lc3plus-ensure-no-code-changes: # check bitexactness to EVS windows binaries be-2-evs-windows: extends: - - .rules-main-push + - .rules-merge-request tags: - ivas-windows stage: test diff --git a/apps/renderer.c b/apps/renderer.c index 858a9d4150..36ea05c60c 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -218,7 +218,9 @@ typedef enum #endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, +#ifdef API_5MS CmdLnOptionId_framing5ms, +#endif CmdLnOptionId_syncMdDelay, CmdLnOptionId_directivityPatternId, CmdLnOptionId_acousticEnvironmentId @@ -1532,8 +1534,8 @@ int main( #endif ); - int16_t num_subframes, sf_idx; #ifdef API_5MS + int16_t num_subframes, sf_idx; num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; #else num_subframes = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index b0a0754c0a..6303fcd23f 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1192,15 +1192,9 @@ ivas_error ivas_jbm_dec_render( if ( st_ivas->hDecoderConfig->Opt_Limiter ) #endif { -#ifdef API_5MS - if ( !( st_ivas->ivas_format == MONO_FORMAT ) ) - { -#endif + #ifndef DISABLE_LIMITER - ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect ); -#endif -#ifdef API_5MS - } + ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect ); #endif } @@ -1410,15 +1404,8 @@ ivas_error ivas_jbm_dec_flush_renderer( if ( st_ivas->hDecoderConfig->Opt_Limiter ) #endif { -#ifdef API_5MS - if ( !( st_ivas->ivas_format == MONO_FORMAT ) ) - { -#endif #ifndef DISABLE_LIMITER - ivas_limiter_dec( st_ivas->hLimiter, p_output, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect ); -#endif -#ifdef API_5MS - } + ivas_limiter_dec( st_ivas->hLimiter, p_output, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect ); #endif } -- GitLab From 45fbbeb8fabb3646fcdcc2aa0818e607b13e15c6 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Wed, 23 Aug 2023 13:44:17 +0200 Subject: [PATCH 5/5] Revert "temporarily introduce bug to trigger failure case" This reverts commit 9ff20d6093480e06406edc8f1f7302a0a76e40a1. --- .gitlab-ci.yml | 2 +- apps/renderer.c | 4 +--- lib_dec/ivas_jbm_dec.c | 19 ++++++++++++++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 463237841b..079d8235e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -907,7 +907,7 @@ lc3plus-ensure-no-code-changes: # check bitexactness to EVS windows binaries be-2-evs-windows: extends: - - .rules-merge-request + - .rules-main-push tags: - ivas-windows stage: test diff --git a/apps/renderer.c b/apps/renderer.c index 36ea05c60c..858a9d4150 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -218,9 +218,7 @@ typedef enum #endif CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, -#ifdef API_5MS CmdLnOptionId_framing5ms, -#endif CmdLnOptionId_syncMdDelay, CmdLnOptionId_directivityPatternId, CmdLnOptionId_acousticEnvironmentId @@ -1534,8 +1532,8 @@ int main( #endif ); -#ifdef API_5MS int16_t num_subframes, sf_idx; +#ifdef API_5MS num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; #else num_subframes = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 6303fcd23f..b0a0754c0a 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1192,9 +1192,15 @@ ivas_error ivas_jbm_dec_render( if ( st_ivas->hDecoderConfig->Opt_Limiter ) #endif { - +#ifdef API_5MS + if ( !( st_ivas->ivas_format == MONO_FORMAT ) ) + { +#endif #ifndef DISABLE_LIMITER - ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect ); + ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect ); +#endif +#ifdef API_5MS + } #endif } @@ -1404,8 +1410,15 @@ ivas_error ivas_jbm_dec_flush_renderer( if ( st_ivas->hDecoderConfig->Opt_Limiter ) #endif { +#ifdef API_5MS + if ( !( st_ivas->ivas_format == MONO_FORMAT ) ) + { +#endif #ifndef DISABLE_LIMITER - ivas_limiter_dec( st_ivas->hLimiter, p_output, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect ); + ivas_limiter_dec( st_ivas->hLimiter, p_output, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect ); +#endif +#ifdef API_5MS + } #endif } -- GitLab