Skip to content

Conversation

@sayalibhavsar
Copy link
Contributor

Description

Adds zero-padding to CoreMark-PRO iteration result filenames to ensure proper numerical sorting when running 10 or more iterations.

Before/After Comparison

Before: Files sorted as run_1, run_10, run_11, ..., run_2, run_3 (lexicographic order).
After: Files sorted as run_01, run_02, ..., run_10, run_11, run_12 (numerical order with minimal zero-padding).

Clerical Stuff

This closes #37

Relates to JIRA: RPOPC-287

@sayalibhavsar
Copy link
Contributor Author

Expected Results Summary

Total Iterations Padding Width File 1 File 5 File 9 File 10 File 99 File 100
9 None 1 5 9
10 2 digits 01 05 09 10
44 2 digits 01 05 09 10
99 2 digits 01 05 09 10 99
100 3 digits 001 005 009 010 099 100
150 3 digits 001 005 009 010 099 100
1000 4 digits 0001 0005 0009 0010 0099 0100

@sayalibhavsar
Copy link
Contributor Author

sbhavsar@sbhavsar-thinkpadp16vgen1:~/coremark_pro-wrapper$ format_iteration_number() { local iter=$1; local total=$2; if [ $total -lt 10 ]; then echo $iter; return; fi; local digits=${#total}; printf "%0${digits}d" $iter; }

echo "Test 1: $(format_iteration_number 5 150) (expected: 005)"
echo "Test 2: $(format_iteration_number 5 44) (expected: 05)"
echo "Test 3: $(format_iteration_number 5 9) (expected: 5)"
echo "Test 4: $(format_iteration_number 99 150) (expected: 099)"
echo "Test 5: $(format_iteration_number 150 150) (expected: 150)"

Test 1: 005 (expected: 005)
Test 2: 05 (expected: 05)
Test 3: 5 (expected: 5)
Test 4: 099 (expected: 099)
Test 5: 150 (expected: 150)

the function works correctly. quick sanity check to verify the zero-padding logic is working as expected

Copy link
Member

@kdvalin kdvalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sayalibhavsar sayalibhavsar merged commit 074ed11 into main Jan 20, 2026
3 of 5 checks passed
Copy link
Contributor

@dvalinrh dvalinrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test result filenames should use leading zeros when running multiple iterations

4 participants