From 55bf8bfa124ecfbd1a3025bfe4c6af50f2c0aca3 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 23 Apr 2025 17:18:21 +0200 Subject: [PATCH 1/4] make ret_val=1 overwrite ret_val=123 if crashes occur (ret_val=1) and at the same time a change in complexity numbers is detected (ret_val=123), the number change previously overwrote the crashes so that the global return value did not reflect the crashes --- ci/complexity_measurements/getWmops.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/complexity_measurements/getWmops.sh b/ci/complexity_measurements/getWmops.sh index 148092eb1a..069bf709fa 100755 --- a/ci/complexity_measurements/getWmops.sh +++ b/ci/complexity_measurements/getWmops.sh @@ -135,12 +135,14 @@ else python3 ci/complexity_measurements/genWebpageData.py --wmops_per_op_log ${wmopsFilenameFlc}_WMOPS.csv --rom_log ${log_rom_all} fi -ret_val=0 python3 ${scriptDir}/check_for_changes.py --wmops_logfiles $(ls ${destDir}/wmops/log_wmops_all*.txt) --ram_logfiles $(ls ${destDir}/wmops/log_ram_all*.txt) --rom_logfile ${destDir}/wmops/log_rom_all.txt -if [ "$?" != "0" ]; then - ret_val=123 -elif [ "$ret_val_script" != "0" ]; then +ret_val_changes=$? + +ret_val=0 +if [ "$ret_val_script" != "0" ]; then ret_val=1 +elif [ "$ret_val_changes" != "0" ]; then + ret_val=123 fi exit $ret_val -- GitLab From d62723ca8fb9572ad8a7c0442dfa6a7c7dccf833 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 23 Apr 2025 18:57:45 +0200 Subject: [PATCH 2/4] remove some old debugging output to de-clutter job log --- ci/complexity_measurements/check_for_changes.py | 4 ---- ci/complexity_measurements/getWmops.sh | 1 - 2 files changed, 5 deletions(-) diff --git a/ci/complexity_measurements/check_for_changes.py b/ci/complexity_measurements/check_for_changes.py index 498d0d1a4d..424b474b71 100644 --- a/ci/complexity_measurements/check_for_changes.py +++ b/ci/complexity_measurements/check_for_changes.py @@ -53,10 +53,6 @@ def check_linewise_logfile(filepath, cols): changes_found = True break - if changes_found: - print("Previous log line:", prev) - print("Current log line:", curr) - return changes_found diff --git a/ci/complexity_measurements/getWmops.sh b/ci/complexity_measurements/getWmops.sh index 069bf709fa..8087cae67b 100755 --- a/ci/complexity_measurements/getWmops.sh +++ b/ci/complexity_measurements/getWmops.sh @@ -89,7 +89,6 @@ ret_val_script=$? # for wmops and RAM graphs, split by levels split_suffixes=("_rate_sw" "_level_1" "_level_2" "_level_3") for suffix in "${split_suffixes[@]}"; do - echo "$suffix" wmopsFilenameFlc_split="${wmopsFilenameFlc}_WMOPS${suffix}.csv" wmopsFilenameFlcLast_split="${wmopsFilenameFlcLast}_WMOPS${suffix}.csv" -- GitLab From 31cf2a8980510189792b96b995bba1a0d02f079f Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 24 Apr 2025 10:41:55 +0200 Subject: [PATCH 3/4] fix indices for runs variable generation --- ci/complexity_measurements/genWebpageData.py | 9 ++-- .../parseNewsletterRam.py | 44 +++++++++-------- .../parseNewsletterRom.py | 48 +++++++++++-------- .../parseNewsletterWmops.py | 9 ++++ 4 files changed, 64 insertions(+), 46 deletions(-) diff --git a/ci/complexity_measurements/genWebpageData.py b/ci/complexity_measurements/genWebpageData.py index cb46bf056e..f567dd1d23 100644 --- a/ci/complexity_measurements/genWebpageData.py +++ b/ci/complexity_measurements/genWebpageData.py @@ -47,9 +47,6 @@ RUNS_KEYS_WMOPS = RUNS_KEYS_COMMON + [ "worstCaseEnc", "worstCaseDec", "worstCaseCodec", - "worstCaseEncRs", - "worstCaseDecRs", - "worstCaseCodecRs", "fixpointScalingFac", ] RUNS_KEYS_WMOPS_PER_OP = [ @@ -82,9 +79,9 @@ RUNS_KEYS = { "wmops_per_op": RUNS_KEYS_WMOPS_PER_OP, } RUNS_LINE_IDX = { - "wmops": [2, 1, 0, 4, 6, 8, 12, 14, 16, 10, 18], - "rom": [2, 1, 0, 4, 6, 8, 10, 12, 14, 16, 18, 20], - "ram": [2, 1, 0, 4, 6, 9, 11, 14, 16, 18], + "wmops": [2, 1, 0, 18, 4, 6, 8, 10], + "rom": [2, 1, 0, 20, 4, 6, 8, 10, 12, 14, 16, 18], + "ram": [2, 1, 0, 18, 4, 6, 9, 11, 14, 16], "wmops_per_op": [0, 4], } diff --git a/ci/complexity_measurements/parseNewsletterRam.py b/ci/complexity_measurements/parseNewsletterRam.py index b7bb4a8517..c6d10681a4 100755 --- a/ci/complexity_measurements/parseNewsletterRam.py +++ b/ci/complexity_measurements/parseNewsletterRam.py @@ -40,6 +40,12 @@ revision = "" shortDate = "" fullDate = "" +""" +The purpose of this script is to convert the csv file output from the IvasBuildAndRunChecks script +into a blank-space separated string which is then appended to an existing file obtained from the last +complexity pipeline run. +""" + if __name__ == "__main__": newsletterFilenameHEAP = sys.argv[1] newsletterFilenameSTACK = sys.argv[2] @@ -135,23 +141,23 @@ for key in ram_table: print( - revision, # string revision $tmp[1] - shortDate, # string shortDate $tmp[2] - fullDate, # string fullDate $tmp[3] - max_total_encdec[1], # value maxTotalRamCodecScore $tmp[4] - max_total_enc[0], # string maxTotalRamEnc $tmp[5] - max_total_enc[1], # value maxTotalRamEnc $tmp[6] - max_total_dec[0], # string maxTotalRamDec $tmp[7] - max_total_dec[1], # value maxTotalRamDecScore $tmp[8] - max_stack_encdec[1], # value maxStackCodecScore $tmp[9] - max_stack_enc[0], # string maxStackEnc $tmp[10] - max_stack_enc[1], # value maxStackEncScore $tmp[11] - max_stack_dec[0], # string maxStackDec $tmp[12] - max_stack_dec[1], # value maxStackDecScore $tmp[13] - max_heap_encdec[1], # value maxHeapCodecScore $tmp[14] - max_heap_enc[0], # string maxHeapEnc $tmp[15] - max_heap_enc[1], # value maxHeapEncScore $tmp[16] - max_heap_dec[0], # string maxHeapDec $tmp[17] - max_heap_dec[1], # value maxHeapDecScore $tmp[19] - newsletterFilenameLast, # string logFile $tmp[19] + revision, # string revision + shortDate, # string shortDate + fullDate, # string fullDate + max_total_encdec[1], # value maxTotalRamCodecScore + max_total_enc[0], # string maxTotalRamEnc + max_total_enc[1], # value maxTotalRamEnc + max_total_dec[0], # string maxTotalRamDec + max_total_dec[1], # value maxTotalRamDecScore + max_stack_encdec[1], # value maxStackCodecScore + max_stack_enc[0], # string maxStackEnc + max_stack_enc[1], # value maxStackEncScore + max_stack_dec[0], # string maxStackDec + max_stack_dec[1], # value maxStackDecScore + max_heap_encdec[1], # value maxHeapCodecScore + max_heap_enc[0], # string maxHeapEnc + max_heap_enc[1], # value maxHeapEncScore + max_heap_dec[0], # string maxHeapDec + max_heap_dec[1], # value maxHeapDecScore + newsletterFilenameLast, # string logFile ) diff --git a/ci/complexity_measurements/parseNewsletterRom.py b/ci/complexity_measurements/parseNewsletterRom.py index 41501282bb..ab61c93a01 100755 --- a/ci/complexity_measurements/parseNewsletterRom.py +++ b/ci/complexity_measurements/parseNewsletterRom.py @@ -41,6 +41,12 @@ revision = "" shortDate = "" fullDate = "" +""" +The purpose of this script is to convert the csv file output from the IvasBuildAndRunChecks script +into a blank-space separated string which is then appended to an existing file obtained from the last +complexity pipeline run. +""" + if __name__ == "__main__": newsletterFilenamePROM = sys.argv[1] newsletterFilenameTROM = sys.argv[2] @@ -140,25 +146,25 @@ for key in rom_table: print( - revision, # string revision $tmp[1] - shortDate, # string shortDate $tmp[2] - fullDate, # string fullDate $tmp[3] - max_total_encdec[1], # value maxTotalRomCodecScore $tmp[4] - max_prom_enc[0], # string maxPROMEnc $tmp[5] - max_prom_enc[1], # value maxPROMEncScore $tmp[6] - max_prom_dec[0], # string maxPROMDec $tmp[7] - max_prom_dec[1], # value maxPROMDecScore $tmp[8] - max_prom_com[0], # string maxPROMCom $tmp[9] - max_prom_com[1], # value maxPROMComScore $tmp[10] - max_prom_rend[0], # string maxPROMRend $tmp[11] - max_prom_rend[1], # value maxPROMRendScore $tmp[12] - max_trom_enc[0], # string maxTROMEnc $tmp[13] - max_trom_enc[1], # value maxTROMEncScore $tmp[14] - max_trom_dec[0], # string maxTROMDec $tmp[15] - max_trom_dec[1], # value maxTROMDecScore $tmp[16] - max_trom_com[0], # string maxTROMCom $tmp[17] - max_trom_com[1], # value maxTROMComScore $tmp[18] - max_trom_rend[0], # string maxTROMRend $tmp[19] - max_trom_rend[1], # value maxTROMRendScore $tmp[20] - newsletterFilenameLast, # string logFile $tmp[21] + revision, # string revision + shortDate, # string shortDate + fullDate, # string fullDate + max_total_encdec[1], # value maxTotalRomCodecScore + max_prom_enc[0], # string maxPROMEnc + max_prom_enc[1], # value maxPROMEncScore + max_prom_dec[0], # string maxPROMDec + max_prom_dec[1], # value maxPROMDecScore + max_prom_com[0], # string maxPROMCom + max_prom_com[1], # value maxPROMComScore + max_prom_rend[0], # string maxPROMRend + max_prom_rend[1], # value maxPROMRendScore + max_trom_enc[0], # string maxTROMEnc + max_trom_enc[1], # value maxTROMEncScore + max_trom_dec[0], # string maxTROMDec + max_trom_dec[1], # value maxTROMDecScore + max_trom_com[0], # string maxTROMCom + max_trom_com[1], # value maxTROMComScore + max_trom_rend[0], # string maxTROMRend + max_trom_rend[1], # value maxTROMRendScore + newsletterFilenameLast, # string logFile ) diff --git a/ci/complexity_measurements/parseNewsletterWmops.py b/ci/complexity_measurements/parseNewsletterWmops.py index 4579ccae8f..26635071ba 100755 --- a/ci/complexity_measurements/parseNewsletterWmops.py +++ b/ci/complexity_measurements/parseNewsletterWmops.py @@ -40,6 +40,12 @@ revision = "" shortDate = "" fullDate = "" +""" +The purpose of this script is to convert the csv file output from the IvasBuildAndRunChecks script +into a blank-space separated string which is then appended to an existing file obtained from the last +complexity pipeline run. +""" + if __name__ == "__main__": newsletterFilename = sys.argv[1] newsletterFilenameLast = sys.argv[2] @@ -67,6 +73,9 @@ with open(newsletterFilename, "r") as csvfile: max_total[0] = re.sub(" ", "_", row[0]) max_total[1] = float(row[3]) +# NOTE: there is a repetiion of some values here. This has historical reasons. +# The repeated values are ignored in the later processing, but to not break the file format +# this is kept as is. print( revision, shortDate, -- GitLab From ee5b1eb9309113d98a262355205eb129408e3cda Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 24 Apr 2025 11:08:24 +0200 Subject: [PATCH 4/4] remove some debug output to de-clutter complexity logs --- .gitlab-ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7a8c30475..c333b8e46f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2458,9 +2458,8 @@ coverage-test-on-main-scheduled: - job_id=$(python3 ci/get_id_of_last_job_occurence.py $CI_COMMIT_REF_NAME $CI_JOB_NAME $CI_PROJECT_ID) - echo $job_id - - curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$job_id/artifacts" --output artifacts.zip - - unzip artifacts.zip || true # this may fail on first run, when there are no artifacts there and the zip file is actually just "404"-html - - ls + - curl --silent --show-error --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$job_id/artifacts" --output artifacts.zip + - unzip -qq artifacts.zip || true # this may fail on first run, when there are no artifacts there and the zip file is actually just "404"-html - public_dir="$CI_JOB_NAME-public" # if is needed to catch case when no artifact is there (first run), similarly as above @@ -2483,7 +2482,6 @@ coverage-test-on-main-scheduled: - fi - fi - - ls wmops - rm artifacts.zip - rm -rf $public_dir @@ -2496,8 +2494,6 @@ coverage-test-on-main-scheduled: - mkdir $public_dir/logs # first move logs - log_files=$(cat $public_dir/graphs*.js | grep logFile | sed "s/.*\(wmops_newsletter_.*\.csv\).*/\1/g") - - echo $log_files - - ls wmops/logs - for f in $log_files; do [ -f wmops/logs/$f ] && mv wmops/logs/$f $public_dir/logs/$f; done # copy index page blueprint - cp ci/complexity_measurements/index_complexity.html ${public_dir}/index.html @@ -2505,7 +2501,6 @@ coverage-test-on-main-scheduled: - sed -i "s/IVAS FORMAT/IVAS $in_format to $out_format/g" ${public_dir}/index.html # do separately here to avoid overwrite complaints by mv - mv -f ci/complexity_measurements/style.css ${public_dir}/ - - ls $public_dir .complexity-template: extends: -- GitLab