<commit_before>#!/bin/bash

function clean_tests {
    #glxgears
    if [ -e glxgears.0000008203.png ];then
        rm glxgears.0000008203.png
    fi
    if [ -e glxgears.trace ];then
        rm glxgears.trace
    fi
    #stunt car racer
    if [ -e stuntcarracer.0000118817.png ];then
        rm stuntcarracer.0000118817.png
    fi
    if [ -e stuntcarracer.trace ];then
        rm stuntcarracer.trace
    fi
    #diff result
    if [ -e diff.png ];then
        rm diff.png
    fi
}

if [ ! -z "$1" ];then
 export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
fi

export LIBGL_FB=3

TESTS=`dirname "$0"`

pushd "$TESTS" >/dev/null

clean_tests

echo "glxgears"

tar xf ../traces/glxgears.tgz
apitrace dump-images --calls="8203" glxgears.trace
result=$(compare -metric AE -fuzz 5% ../refs/glxgears.0000008203.png glxgears.0000008203.png diff.png 2>&1)
if [ ! "$result" -lt "5" ];then
    popd >/dev/null
    echo "error, $result pixels diff"
    exit 1
fi

echo "StuntCarRacer"

tar xf ../traces/stuntcarracer.tgz
apitrace dump-images --calls="118817" stuntcarracer.trace
result=$(compare -metric AE -fuzz 20% -extract 638x478+1+1 ../refs/stuntcarracer.0000118817.png stuntcarracer.0000118817.png diff.png 2>&1)
if [ ! "$result" -lt "20" ];then
    popd >/dev/null
    echo "error, $result pixels diff"
    exit 1
fi

# cleanup
clean_tests

popd >/dev/null
echo "All done"
exit 0<commit_msg>Add more fuzz to glxgears regression test<commit_after>#!/bin/bash

function clean_tests {
    #glxgears
    if [ -e glxgears.0000008203.png ];then
        rm glxgears.0000008203.png
    fi
    if [ -e glxgears.trace ];then
        rm glxgears.trace
    fi
    #stunt car racer
    if [ -e stuntcarracer.0000118817.png ];then
        rm stuntcarracer.0000118817.png
    fi
    if [ -e stuntcarracer.trace ];then
        rm stuntcarracer.trace
    fi
    #diff result
    if [ -e diff.png ];then
        rm diff.png
    fi
}

if [ ! -z "$1" ];then
 export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
fi

export LIBGL_FB=3

TESTS=`dirname "$0"`

pushd "$TESTS" >/dev/null

clean_tests

echo "glxgears"

tar xf ../traces/glxgears.tgz
apitrace dump-images --calls="8203" glxgears.trace
result=$(compare -metric AE -fuzz 20% ../refs/glxgears.0000008203.png glxgears.0000008203.png diff.png 2>&1)
if [ ! "$result" -lt "25" ];then
    popd >/dev/null
    echo "error, $result pixels diff"
    exit 1
fi

echo "StuntCarRacer"

tar xf ../traces/stuntcarracer.tgz
apitrace dump-images --calls="118817" stuntcarracer.trace
result=$(compare -metric AE -fuzz 20% -extract 638x478+1+1 ../refs/stuntcarracer.0000118817.png stuntcarracer.0000118817.png diff.png 2>&1)
if [ ! "$result" -lt "20" ];then
    popd >/dev/null
    echo "error, $result pixels diff"
    exit 1
fi

# cleanup
clean_tests

popd >/dev/null
echo "All done"
exit 0
{'fraction_non_alphanumeric': 0.12750716332378223, 'fraction_numerical': 0.0830945558739255, 'mean_word_length': 2.93935119887165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2043573', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1100, 'n_words': 277}