<commit_before>#!/bin/bash

ITERATIONS=$1
shift
TAG=$1
shift
# seriously shell scripts are the worst and I should stop
ARGS="$1"
shift
PROGRAMS="$@"

# But instead of stopping I am making it worse.
RUN=1
while [ $RUN ]
do
	RUN=
    for PROGRAM in $PROGRAMS
    do
		FILE=data/$PROGRAM-$TAG.csv
		LEN=$(test -a $FILE && wc -l $FILE | cut -f1 -d" " || echo 0)
		if [ $LEN -lt $ITERATIONS ]
		then
			I=$(expr $LEN + 1)
			printf "%d,%s,%s %s,$PROGRAM,$ARGS," $I `hostname` \
				   `date --rfc-3339=seconds -u` >> $FILE
			env -i ./build/$PROGRAM -b $ARGS >> $FILE
			#sleep 60 # evade, don't solve, temperature problems
			RUN=1
		fi
    done
done<commit_msg>Have bench.sh build the programs it runs<commit_after>#!/bin/bash

ITERATIONS=$1
shift
TAG=$1
shift
# seriously shell scripts are the worst and I should stop
ARGS="$1"
shift
PROGRAMS="$@"

# Make sure they are all up to date
for PROGRAM in $PROGRAMS
do
	make -j4 build/$PROGRAM
done

# But instead of stopping I am making it worse.
RUN=1
while [ $RUN ]
do
	RUN=
    for PROGRAM in $PROGRAMS
    do
		FILE=data/$PROGRAM-$TAG.csv
		LEN=$(test -a $FILE && wc -l $FILE | cut -f1 -d" " || echo 0)
		if [ $LEN -lt $ITERATIONS ]
		then
			I=$(expr $LEN + 1)
			printf "%d,%s,%s %s,$PROGRAM,$ARGS," $I `hostname` \
				   `date --rfc-3339=seconds -u` >> $FILE
			env -i ./build/$PROGRAM -b $ARGS >> $FILE
			#sleep 60 # evade, don't solve, temperature problems
			RUN=1
		fi
    done
done
{'fraction_non_alphanumeric': 0.15159944367176634, 'fraction_numerical': 0.020166898470097356, 'mean_word_length': 2.9972222222222222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5753590', 'n_tokens_mistral': 616, 'n_tokens_neox': 534, 'n_words': 188}