<commit_before><html>
<head>
<title>Shake Report</title>
<style type="text/css">
body {font-family: sans-serif;}
</style>

<script src="../output/self/.js"> </script>
<script src="jquery-1.7.1.min.js"> </script>

<script>
// first find which runs have built data in them, sorted
// built :: [Int]
var built = function(){
	var seen = {};
	for (var i = 0; i < shake.length; i++)
		seen[shake[i].built] = true;
	var seen2 = [];
	for (var i in seen)
		seen2.push(i);
	return seen2.sort(function cmp(a,b){return a-b;});
}();

// what is the index of the last build run
// lastRun :: Int
var lastRun = built.length == 0 ? 0 : built[built.length-1];

function showTime(x){return x.toFixed(1) + "s";}
function showShort(x){return x;}

function plural(n,not1,is1){
	return n == 1
		? (is1 == undefined ? "" : is1)
		: (not1 == undefined ? "s" : not1);
}


function summary()
{
	var countLast = 0;
	var countUnchanged = 0, countUnchangedLast = 0;
	var sumExecution = 0, sumExecutionLast = 0;
	var maxExecution = 0;
	var countTrace = 0, countTraceLast = 0;
	var sumTrace = 0;
	var maxTrace = 0;
	var maxTraceStopLast = 0;
	for (var i = 0; i < shake.length; i++)
	{
		var isLast = shake[i].built == lastRun;
		countLast += isLast ? 1 : 0;
		countUnchanged += shake[i].built != shake[i].changed ? 1 : 0;
		countUnchangedLast += isLast && shake[i].built != shake[i].changed ? 1 : 0;
		sumExecution += shake[i].execution;
		sumExecutionLast += isLast ? shake[i].execution : 0;
		maxExecution = Math.max(maxExecution, shake[i].execution);
		var traces = shake[i].traces;
		if (!traces) continue;
		for (var j = 0; j < traces.length; j++)
		{
			countTrace += 1;
			countTraceLast += isLast ? 1 : 0;
			sumTrace += traces[j].stop - traces[j].start;
			maxTrace = Math.max(maxTrace, traces[j].stop - traces[j].start);
			maxTraceStopLast = Math.max(maxTraceStopLast, isLast ? traces[j].stop : 0);
		}
	}

	var buckets = [];
	var countBuckets = 100;
	for (var i = 0; i <= countBuckets; i++)
		buckets.push(0); // fill with 1 more element, but the last bucket will always be 0

	for (var i = 0; i < shake.length; i++)
	{
		var traces = shake[i].traces;
		if (!traces || shake[i].built != lastRun) continue;
		for (var j = 0; j < traces.length; j++)
		{
			var start = traces[j].start * countBuckets / maxTraceStopLast;
			var stop = traces[j].stop * countBuckets / maxTraceStopLast;
			for (var k = Math.ceil(start); k < Math.floor(stop); k++)
				buckets[k]++;
			buckets[Math.floor(start)] += start - Math.floor(start);
			buckets[Math.floor(stop)] += stop - Math.floor(stop);
		}
	}
	var maxBucket = 0;
	for (var i = 0; i < countBuckets; i++)
		maxBucket = Math.max(maxBucket, buckets[i]);
	maxBucket = Math.ceil(maxBucket);

	var chart = "cht=lc&amp;chs=300x100&amp;chco=22AA47&amp;chm=B,6DC097,0,0,0&amp;chxt=y&amp;chxl=0:|0|" + maxBucket + "&amp;chls=3,1,0&amp;chd=t:";
	for (var i = 0; i < countBuckets; i++)
		chart += (i == 0 ? "" : ",") + (buckets[i] * 100 / maxBucket);

	$("#content").html(<commit_msg>Fix the bucketing code, before was mathematically incorrect<commit_after><html>
<head>
<title>Shake Report</title>
<style type="text/css">
body {font-family: sans-serif;}
</style>

<script src="../output/self/.js"> </script>
<script src="jquery-1.7.1.min.js"> </script>

<script>
// first find which runs have built data in them, sorted
// built :: [Int]
var built = function(){
	var seen = {};
	for (var i = 0; i < shake.length; i++)
		seen[shake[i].built] = true;
	var seen2 = [];
	for (var i in seen)
		seen2.push(i);
	return seen2.sort(function cmp(a,b){return a-b;});
}();

// what is the index of the last build run
// lastRun :: Int
var lastRun = built.length == 0 ? 0 : built[built.length-1];

function showTime(x){return x.toFixed(1) + "s";}
function showShort(x){return x;}

function plural(n,not1,is1){
	return n == 1
		? (is1 == undefined ? "" : is1)
		: (not1 == undefined ? "s" : not1);
}


function summary()
{
	var countLast = 0;
	var countUnchanged = 0, countUnchangedLast = 0;
	var sumExecution = 0, sumExecutionLast = 0;
	var maxExecution = 0;
	var countTrace = 0, countTraceLast = 0;
	var sumTrace = 0;
	var maxTrace = 0;
	var maxTraceStopLast = 0;
	for (var i = 0; i < shake.length; i++)
	{
		var isLast = shake[i].built == lastRun;
		countLast += isLast ? 1 : 0;
		countUnchanged += shake[i].built != shake[i].changed ? 1 : 0;
		countUnchangedLast += isLast && shake[i].built != shake[i].changed ? 1 : 0;
		sumExecution += shake[i].execution;
		sumExecutionLast += isLast ? shake[i].execution : 0;
		maxExecution = Math.max(maxExecution, shake[i].execution);
		var traces = shake[i].traces;
		if (!traces) continue;
		for (var j = 0; j < traces.length; j++)
		{
			countTrace += 1;
			countTraceLast += isLast ? 1 : 0;
			sumTrace += traces[j].stop - traces[j].start;
			maxTrace = Math.max(maxTrace, traces[j].stop - traces[j].start);
			maxTraceStopLast = Math.max(maxTraceStopLast, isLast ? traces[j].stop : 0);
		}
	}

	var buckets = [];
	var countBuckets = 100;
	for (var i = 0; i <= countBuckets; i++)
		buckets.push(0); // fill with 1 more element, but the last bucket will always be 0

	for (var i = 0; i < shake.length; i++)
	{
		var traces = shake[i].traces;
		if (!traces || shake[i].built != lastRun) continue;
		for (var j = 0; j < traces.length; j++)
		{
			var start = traces[j].start * countBuckets / maxTraceStopLast;
			var stop = traces[j].stop * countBuckets / maxTraceStopLast;

			if (Math.floor(start) == Math.floor(stop))
				buckets[Math.floor(start)] += stop - start;
			else
			{
				for (var k = Math.ceil(start); k < Math.floor(stop); k++)
					buckets[k]++;
				buckets[Math.floor(start)] += Math.ceil(start) - start;
				buckets[Math.floor(stop)] += stop - Math.floor(stop);
			}
		}
	}
	var maxBucket = 0;
	for (var i = 0; i < countBuckets; i++)
		maxBucket = Math.max(maxBucket, buckets[i]);
	maxBucket = Math.ceil(maxBucket - 0.00001);

	var chart = "cht=lc&amp;chs=300x100&amp;chco=22AA47&amp;chm=B,6DC097,0,0,0&amp;chxt=y&amp;chxl=0:|0|" + maxBucket + "&amp;chls=3,1,0&amp;chd=t:";
	for (var i = 0; i < countBuckets; i++)
		chart += (i == 0 ? "" : ",") + (buckets[i] * 100 / maxBucket);

	$("#content").html(
{'fraction_non_alphanumeric': 0.18311688311688312, 'fraction_numerical': 0.026948051948051947, 'mean_word_length': 3.7428791377983064, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 25, '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': '7103572', 'n_tokens_mistral': 2567, 'n_tokens_neox': 2304, 'n_words': 604}