<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Breaking Eggs And Making Omelettes &#187; FATE Server</title>
	<atom:link href="http://multimedia.cx/eggs/category/fate-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://multimedia.cx/eggs</link>
	<description>Topics On Multimedia Technology and Reverse Engineering</description>
	<lastBuildDate>Sun, 29 Apr 2012 05:01:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Using gcovr with FFmpeg</title>
		<link>http://multimedia.cx/eggs/using-gcovr-with-ffmpeg/</link>
		<comments>http://multimedia.cx/eggs/using-gcovr-with-ffmpeg/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 03:16:59 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2856</guid>
		<description><![CDATA[Having another go at analyzing FFmpeg code coverage using gcov, with the help of another tool called gcovr]]></description>
			<content:encoded><![CDATA[<p>When I started <a href="http://multimedia.cx/eggs/ffmpeg-and-code-coverage-tools/">investigating code coverage tools to analyze FFmpeg</a>, I knew there had to be an easier way to do what I was trying to do (obtain code coverage statistics on a macro level for the entire project). I was hoping there was a way to ask the GNU gcov tool to do this directly. <a href="http://multimedia.cx/eggs/ffmpeg-and-code-coverage-tools/#comment-152753">John K informed me in the comments</a> of <a href="https://software.sandia.gov/trac/fast/wiki/gcovr">a tool called gcovr</a>. Like my tool from the previous post, gcovr is a Python script that aggregates data collected by gcov. gcovr proves to be a little more competent than my tool.</p>
<p><strong>Results</strong><br />
<strong><a href="https://spreadsheets.google.com/pub?key=0AjHexWy1UYqidHN4RFNYOTNPZjdna0tLa0M1MlFYMFE&#038;hl=en&#038;output=html">Here is the spreadsheet of results</a></strong>, reflecting <a href="http://fate.ffmpeg.org/">FATE</a> code coverage as of this writing. All FFmpeg source files are on the same sheet this time, including header files, sorted by percent covered (ascending), then total lines (descending).</p>
<p><strong>Methodology</strong><br />
I wasn&#8217;t easily able to work with the default output from the gcovr tool. So I modified it into a tool called gcovr-csv which creates data that spreadsheets can digest more easily.</p>
<ul>
<li>Build FFmpeg using the <code>'-fprofile-arcs -ftest-coverage'</code> in both the extra cflags and extra ldflags configuration options</li>
<li><code>'make'</code></li>
<li><code>'make fate'</code></li>
<li>From build directory: <code>'gcovr-csv &gt; output.csv'</code></li>
<li>Massage the data a bit, deleting information about system header files (assuming you don&#8217;t care how much of /usr/include/stdlib.h is covered &#8212; 66%, BTW)</li>
</ul>
<p><strong>Leftovers</strong><br />
I became aware of some spreadsheet limitations thanks to this tool:<span id="more-2856"></span></p>
<ol>
<li>OpenOffice can&#8217;t process percent values correctly&#8211; it imports the percent data from the CSV file but sorts it alphabetically rather than numerically.</li>
<li>Google Spreadsheet expects CSV to really be comma-delimited&#8211; forget about any other delimiters. Also, line length is an issue which is why I needed my tool to omit the uncovered line number ranges, which it does in its default state.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/using-gcovr-with-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Bye Bye FATE Machine</title>
		<link>http://multimedia.cx/eggs/bye-bye-fate-machine/</link>
		<comments>http://multimedia.cx/eggs/bye-bye-fate-machine/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 05:21:50 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2847</guid>
		<description><![CDATA[The Shuttle SD37P2 v2 is a great computer but I just don''t need that much power anymore]]></description>
			<content:encoded><![CDATA[<p>This is the computer that performed the lion&#8217;s share of FATE cycles for the past 1.5 years before Mans put a <a href="http://fate.ffmpeg.org/">new continuous integration system</a> into service. I&#8217;ve now decided to let the machine go. I can&#8217;t get over how odd this feels since this thing is <strong>technically the best machine I own</strong>.</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/09/shuttle-sn37p2v2.jpg" alt="" title="Shuttle SN37P2 v2 machine" width="350" height="277" class="aligncenter size-full wp-image-2848" /><br />
</center></p>
<p>It&#8217;s a small form factor Shuttle PC (SD37P2 v2); Core 2 Duo 2.13 GHz; 2 GB RAM; 400 GB SATA HD; equipped with the only consistently functional optical drive in my house (<a href="http://multimedia.cx/eggs/optical-drive-value-proposition/">uh oh</a>). I used it as my primary desktop from <a href="http://games.multimedia.cx/new-computer-night/">March 2007</a> &#8211; November 2008, at which point <a href="http://multimedia.cx/eggs/32-bit-shuffling/">I repurposed it for FATE cycles</a>.</p>
<p>As mentioned, the craziest part is that this is technically the best computer in my house. My <a href="http://multimedia.cx/eggs/i-really-like-my-new-eeepc/">new EeePC 1201PN</a> isn&#8217;t at quite the same level; <a href="http://multimedia.cx/eggs/eee-pc-multimedia/">my old EeePC</a> can&#8217;t touch it, of course; <a href="http://multimedia.cx/eggs/64-bit-builds-are-a-go/">the Mac Mini</a> has a little more RAM but doesn&#8217;t stack up in nearly all other areas. But the Shuttle just isn&#8217;t seeing that much use since <a href="http://multimedia.cx/eggs/usurper-of-fate/">the usurpation</a>. I had it running automated backup duty for multimedia.cx but that&#8217;s easy enough to move to another, lower-powered system.</p>
<p>Maybe the prognosticators are correct and the PC industry has matured to the point where raw computing power simply doesn&#8217;t matter anymore. I fancy myself as someone who knows how to put CPU power to work but even I don&#8217;t know what to do with the computing capacity I purchased over 3 years ago.</p>
<p>Where will the Shuttle go? A good home, I trust&#8211; I know a family that just arrived in the country and could use a computer.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/bye-bye-fate-machine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ANSI FATE</title>
		<link>http://multimedia.cx/eggs/ansi-fate/</link>
		<comments>http://multimedia.cx/eggs/ansi-fate/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 05:55:44 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2770</guid>
		<description><![CDATA[FATE has 700 tests including one for the new ANSI terminal art subsystem; also tests OS/2 and a new MIPS CPU]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://fate.ffmpeg.org/">new FATE server</a> is shaping up well. I think most of the <a href="http://fate.multimedia.cx/">old configurations</a> have been migrated to the new server. I see one new compiler for x86_64&#8211; <a href="http://www.pathscale.com/">PathScale</a>. It&#8217;s <a href="http://fate.ffmpeg.org/x86_64-linux-path64">not faring particularly well</a> at this point.</p>
<p><strong>New Tests</strong><br />
As I write this, I noticed that there are now an even 700 tests, twice as many as the <a href="http://multimedia.cx/eggs/350-tests/">last time I trumpeted such a milestone</a>. (It should be noted that the new FATE system finally breaks down the master regression suite into individual tests.) Thankfully, it&#8217;s no longer necessary to wait for me to create or edit tests (anyone with FFmpeg privileges can do this), nor is it necessary to keep up with this blog to know exactly what tests are new. Now, you can simply inspect the file history on tests/fate.mak and tests/fate2.mak (I think these 2 files are going to merge in the near future).</p>
<p>Vitor, as of r24865: &#8220;Add FATE test for ANSI/ASCII animation and TTY demuxer.&#8221; Eh? What&#8217;s this about? I admit I was completely removed from FFmpeg development for much of June and July so I could have missed a lot. Fortunately, I can check the file history to see which lines were added to make this test happen. And if FATE is exercising the test, you know exactly <a href="http://samples.mplayerhq.hu/fate-suite/">where the samples will live</a>. Here&#8217;s this new decoder in action on <a href="http://samples.mplayerhq.hu/fate-suite/ansi/">the relevant sample</a>:</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/08/ffplay-ansi-animation.jpg" alt="" title="FFplay playing an ANSI art animation" width="400" height="269" class="aligncenter size-full wp-image-2771" /><br />
</center></p>
<p>The file history fingers <a href="http://wiki.multimedia.cx/index.php?title=User:Suxen_drol">Suxen drol/Peter Ross</a> for this handiwork. I might have guessed&#8211; the only person who is arguably more enamored with old, weird formats than even I. Now we wait for the day that YouTube has support for this format. I&#8217;m sure there are huge archives of these animations out there (and I wager that <a href="http://trixter.wordpress.com/">Trixter</a> and <a href="http://ascii.textfiles.com/">Jason Scott</a> know where).</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/08/ffplay-ansi-animation-part-2.jpg" alt="" title="FFplay ANSI animation 2 -- ANSI breasts" width="400" height="272" class="aligncenter size-full wp-image-2782" /><br />
<em>It&#8217;s an animation &#8212; it just keeps going</em><br />
</center></p>
<p>Meanwhile, the FATE suite now encompasses a bunch of perceptual audio formats, thanks to <a href="http://multimedia.cx/eggs/not-an-exact-science/">the 1-off testing method</a> and a few other techniques. These formats include Bink audio, WMA Pro, WMA voice, Vorbis, ATRAC1, ATRAC3, MS-GSM, AC3, E-AC3, NellyMoser, TrueSpeech, Intel Music Coder, QDM2, RealAudio Cooker, QCELP (just going down the source control log here), and others, no doubt.</p>
<p>Then there&#8217;s this curious tidbit: &#8220;Add FATE test for WMV8 DRM&#8221;. The test spec is <code>"fate-wmv8-drm: CMD = framecrc -cryptokey 137381538c84c068111902a59c5cf6c340247c39 -i $(SAMPLES)/wmv8/wmv_drm.wmv -an"</code>. I would still like to investigate FFmpeg&#8217;s cryptographic capabilities, which I suspect are moving in a direction to function as a complete SSL stack one day.</p>
<p><strong>New Platforms</strong><br />
As for new platforms, the new FATE system finally allows testing on OS/2 (remember that classic? It was <a href="http://www.vintagecomputing.com/index.php/archives/40">&#8220;the totally cool way to run your computer&#8221;</a>). Thanks to Dave Yeo for taking this on.</p>
<p>Further, a new MIPS-based platform recently appeared on the FATE list. This one reports itself as running on 74kf CPU. Googling for this processor quickly brings up <a href="http://hardwarebug.org/2010/05/03/hacking-the-popcorn-hour-c-200/">Mans&#8217; post about the Popcorn Hour device</a>. So, congratulations to him for getting the mundane box to serve a higher purpose. Perhaps one day, I&#8217;ll be able to do the same for that <a href="http://multimedia.cx/eggs/got-a-cheap-mips-subnotebook/">Belco Alpha-400 netbook</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/ansi-fate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FFmpeg and Code Coverage Tools</title>
		<link>http://multimedia.cx/eggs/ffmpeg-and-code-coverage-tools/</link>
		<comments>http://multimedia.cx/eggs/ffmpeg-and-code-coverage-tools/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 16:26:26 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2761</guid>
		<description><![CDATA[Learning how to apply the GNU gcov tool against FFmpeg]]></description>
			<content:encoded><![CDATA[<p>Code coverage tools likely occupy the same niche as profiling tools: Tools that you're <em>supposed</em> to use somewhere during the software engineering process but probably never quite get around to it, usually because you're too busy adding features or fixing bugs. But there may come a day when you wish to learn how much of your code is actually being exercised in normal production use. For example, the team charged with continuously testing the <a href="http://ffmpeg.org/">FFmpeg</a> project, would be curious to know how much code is being exercised, especially since many of the FATE test specs explicitly claim to be "exercising XYZ subsystem".</p>
<p>The primary GNU code coverage tool is called gcov and is probably already on your GNU-based development system. I set out to determine how much FFmpeg source code is exercised while running the full FATE suite. I ran into some problems when trying to use gcov on a project-wide scale. I spackled around those holes with some very ad-hoc solutions. I'm sure I was just overlooking some more obvious solutions about which you all will be happy to enlighten me.</p>
<p><strong>Results</strong><br />
I've learned to cut to the chase earlier in blog posts (results first, methods second). With that, here are the results I produced from this experiment. <a href="http://spreadsheets.google.com/pub?key=0AjHexWy1UYqidDhwXzctSDA2NjZCNFVaTXFfTldUV2c&#038;hl=en&#038;output=html">This Google spreadsheet</a> contains 3 sheets: The <a href="http://spreadsheets.google.com/pub?key=0AjHexWy1UYqidDhwXzctSDA2NjZCNFVaTXFfTldUV2c&#038;hl=en&#038;gid=0">first contains code coverage stats</a> for a bunch of FFmpeg C files sorted first by percent coverage (ascending), then by number of lines (descending), thus highlighting which files have the most uncovered code (ffserver.c currently tops that chart). The <a href="http://spreadsheets.google.com/pub?key=0AjHexWy1UYqidDhwXzctSDA2NjZCNFVaTXFfTldUV2c&#038;hl=en&#038;gid=1">second sheet has files</a> for which no stats were generated. The <a href="http://spreadsheets.google.com/pub?key=0AjHexWy1UYqidDhwXzctSDA2NjZCNFVaTXFfTldUV2c&#038;hl=en&#038;gid=2">third sheet has "problems"</a>. These files were rejected by my ad-hoc script.</p>
<p><a href="http://spreadsheets.google.com/pub?key=0AjHexWy1UYqidDhwXzctSDA2NjZCNFVaTXFfTldUV2c&#038;hl=en&#038;gid=0&#038;output=csv">Here's a link to the data in CSV</a> if you want to play with it yourself.</p>
<p><strong>Using gcov with FFmpeg</strong> <span id="more-2761"></span><br />
To instrument a program for gcov analysis, compile and link the target program with the -fprofile-arcs and -ftest-coverage options. These need to be applied at both the compile and link stages, so in the case of FFmpeg, configure with:</p>
<pre>
  ./configure \
    --extra-cflags="-fprofile-arcs -ftest-coverage" \
    --extra-ldflags="-fprofile-arcs -ftest-coverage"
</pre>
<p>The building process results in a bunch of .gcno files which pertain to code coverage. After running the program as normal, a bunch of .gcda files are generated. To get coverage statistics from these files, run <code>'gcov sourcefile.c'</code>. This will print some basic statistics as well as generate a corresponding .gcov file with more detailed information about exactly which lines have been executed, and how many times.</p>
<p>Be advised that the source file must either live in the same directory from which gcov is invoked, or else the path to the source must be given to gcov via the <code>'-o, --object-directory'</code> option.</p>
<p><strong>Resetting Statistics</strong><br />
Statistics in the .gcda files are cumulative. Should you wish to reset the statistics, doing this in the build directory should suffice:</p>
<pre>
  find . -name "*.gcda" | xargs rm -f
</pre>
<p><strong>Getting Project-Wide Data</strong><br />
As mentioned, I had to get a little creative here to get a big picture of FFmpeg code coverage. After building FFmpeg with the code coverage options and running FATE,</p>
<pre>
for file in `find . -name "*.c"` \
do \
  echo "*****" $file \
  gcov -o `dirname $file` `basename $file` \
done > ffmpeg-code-coverage.txt 2>&#038;1
</pre>
<p>After that, I ran the ffmpeg-code-coverage.txt file through a custom Python script to print out the 3 CSV files that I later dumped into the Google Spreadsheet.</p>
<p><strong>Further Work</strong><br />
I'm sure there are better ways to do this, and I'm sure you all will let me know what they are. But I have to get the ball rolling somehow.</p>
<p>There's also <a href="http://testcocoon.org/">TestCocoon</a>. I'd like to try that program and see if it addresses some of gcov's shortcomings (assuming they are indeed shortcomings rather than oversights).</p>
<p><strong>Source for script: process-gcov-slop.py</strong></p>
<div class="igBar"><span id="lpython-1"><a href="#" onclick="javascript:showPlainTxt('python-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PYTHON:</span>
<div id="python-1">
<div class="python">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">lines = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">"ffmpeg-code-coverage.txt"</span><span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">splitlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">no_coverage = <span style="color: #483d8b;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">coverage = <span style="color: #483d8b;">"filename, % covered, total lines<span style="color: #000099; font-weight: bold;">\n</span>"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">problems = <span style="color: #483d8b;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">stats_exp = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Lines executed:(<span style="color: #000099; font-weight: bold;">\d</span>+<span style="color: #000099; font-weight: bold;">\.</span><span style="color: #000099; font-weight: bold;">\d</span>+)% of (<span style="color: #000099; font-weight: bold;">\d</span>+)'</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>lines<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; line = lines<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> line.<span style="color: black;">startswith</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">"***** "</span><span style="color: black;">&#41;</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; filename = line<span style="color: black;">&#91;</span>line.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'./'</span><span style="color: black;">&#41;</span>+<span style="color: #ff4500;color:#800000;">2</span>:<span style="color: black;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; i += <span style="color: #ff4500;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> lines<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span>.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">":cannot open graph file"</span><span style="color: black;">&#41;</span> != -<span style="color: #ff4500;color:#800000;">1</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; no_coverage += filename + <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">while</span> lines<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span>.<span style="color: black;">find</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span> == -<span style="color: #ff4500;color:#800000;">1</span> <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: #ff7700;font-weight:bold;">not</span> lines<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span>.<span style="color: black;">startswith</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">"***** "</span><span style="color: black;">&#41;</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i += <span style="color: #ff4500;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">try</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#40;</span>percent, total_lines<span style="color: black;">&#41;</span> = stats_exp.<span style="color: black;">findall</span><span style="color: black;">&#40;</span>lines<span style="color: black;">&#91;</span>i+<span style="color: #ff4500;color:#800000;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;color:#800000;">0</span><span style="color: black;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; coverage += filename + <span style="color: #483d8b;">', '</span> + percent + <span style="color: #483d8b;">', '</span> + total_lines + <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">IndexError</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; problems += filename + <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">"no_coverage.csv"</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span>no_coverage<span style="color: black;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">"coverage.csv"</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span>coverage<span style="color: black;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">"problems.csv"</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span>problems<span style="color: black;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/ffmpeg-and-code-coverage-tools/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>New FATE Test Coverage System</title>
		<link>http://multimedia.cx/eggs/new-fate-test-coverage-system/</link>
		<comments>http://multimedia.cx/eggs/new-fate-test-coverage-system/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 05:22:23 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2654</guid>
		<description><![CDATA[Accounting for FFmpeg's test coverage in an automated manner]]></description>
			<content:encoded><![CDATA[<p>I've been feeling a bit scattered for the last week since I was <a href="http://multimedia.cx/eggs/usurper-of-fate/">fired from my volunteer position as the FFmpeg QA manager</a>, wondering if there is anything I should attempt to do with the project. It can't be denied that <a href="http://fate.ffmpeg.org/">the new system</a> is working well. But one area I've wondered about is test coverage.</p>
<p>Under my old regime I <a href="http://wiki.multimedia.cx/index.php?title=FATE_Test_Coverage">tracked test coverage as a wiki page</a> which was a highly flawed method-- tedious and error-prone. There are those 2 adjectives again-- tedious and error-prone; whenever I see those, I search for automation methods. I think that might be more plausible thanks to the new FATE's tighter integration with the FFmpeg build system.</p>
<p>I don't think anyone is working on this problem so I wanted to toss out a brainstorm:</p>
<ol>
<li>First, run 'ffmpeg -formats', 'ffmpeg -codecs', etc. and parse the output to collect a list of all the features (full list: -formats, -codecs, -bsfs, -protocols, -filters, -pix_fmts). Transform these lists into a standardized list of features, e.g., <code>"DEVSD  ffvhuff         Huffyuv FFmpeg variant"</code> represents features 'decode-video-ffvhuff', 'encode-video-ffvhuff', 'ffvhuff-horizband', and 'ffvhuff-dr1'.</li>
<li>Next, tag each individual test spec with the features that it exercises. E.g., test 'fate-vqa-cc' exercises features 'demux-wsvqa', 'decode-video-vqavideo', and 'decode-audio-adpcm_ima_ws'.</li>
<li>Finally, compare the data from parts 1 and 2. Print a list of all the features that are not exercised in FATE.</li>
</ol>
<p>I think a lot of this could be implemented at the GNU make level. Then again, I'm no expert on GNU make syntax so I may be overestimating its capabilities. Or there might be simpler ways to automatically track test coverage stats based on the improved testing infrastructure.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/new-fate-test-coverage-system/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>FATE&#8217;s New Look</title>
		<link>http://multimedia.cx/eggs/fates-new-look/</link>
		<comments>http://multimedia.cx/eggs/fates-new-look/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 05:21:51 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2633</guid>
		<description><![CDATA[Aggregating a lot of information in a simple line with 3 colors]]></description>
			<content:encoded><![CDATA[<p>The FATE main page exposes a lot of data. The manner in which it is presented has always been bounded by my extremely limited web development abilities. I wrestled with whether I should learn better web development skills first and allow that to inform any improved design, or focus on the more useful design and invest my web development learning time towards realizing that design.</p>
<p>Fortunately, <a href="http://fate.ffmpeg.org/">Mans solved this conundrum with an elegantly simple solution</a>:</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/08/fate-tng-failometer.png" alt="" title="The new FATE failometer" width="548" height="112" class="aligncenter size-full wp-image-2634" /><br />
</center></p>
<p>The top of the page displays a status bar that illustrates -- at a glance -- how functional the codebase is. The web page source code identifies this as the <strong>failometer</strong>. It took me a few seconds to recognize what information that status bar was attempting to convey; maybe it could use a succinct explanation.</p>
<p><strong>Mini-Book Review</strong><br />
<span id="more-2633"></span><br />
Before Mans took over, I thought about this problem quite a bit. I needed inspiration for creating a better FATE main page and aggregating a large amount of data in a useful, easily-digested form. Looking around the web, I see no shortage of methods for visualizing data. I could start shoehorning FATE data into available methods and see what works. But I thought it would be better to take a step back and think about the best way to organize the data. My first clue came awhile ago in the form of an xkcd comic: <a href="http://xkcd.com/124/">Blogofractal</a>. Actually, the clue came from the mouseover text which recommended <a href="http://amzn.com/0961392142">Edward Tufte's "The Visual Display of Quantitative Information"</a>.</p>
<p><center><a href="http://amzn.com/0961392142"><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/08/visual-display-of-quantitative-information.jpg" alt="" title="Cover of &quot;Visual Display of Quantitative Information&quot;" width="192" height="230" class="aligncenter size-full wp-image-2637" /></a><br />
</center></p>
<p>I ordered this up and plowed through it. It's an interesting read, to be sure. However, I think it illustrates what a book on multimedia and compression technology would look like if authored by yours truly-- a book of technical curiosities from epochs past that discusses little in the way of modern practical application. Tufte's book showed me lots of examples of infographics from decades and even centuries past, but I never concisely learned exactly how to present data such as FATE's main page in a more useful form.</p>
<p><strong>Visualization Blog</strong><br />
More recently, I discovered a blog called <a href="http://flowingdata.com/">Flowing Data</a>, authored by a statistics Ph.D. candidate who purportedly eats, sleeps, and breathes infographics. The post <a href="http://flowingdata.com/2010/01/07/11-ways-to-visualize-changes-over-time-a-guide/">11 Ways to Visualize Changes Over Time: A Guide</a> offers a good starting point for creating useful data presentations.</p>
<p>I still subscribe to and eagerly read Flowing Data. But I might not have as much use for data visualization now that Mans is on FATE duty.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/fates-new-look/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FATE Under New Management</title>
		<link>http://multimedia.cx/eggs/fate-under-new-management/</link>
		<comments>http://multimedia.cx/eggs/fate-under-new-management/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 02:45:02 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2624</guid>
		<description><![CDATA[Understanding FFmpeg's new continuous integration system]]></description>
			<content:encoded><![CDATA[<p>At any given time, I have between 20-30 blog posts in some phase of development. Half of them seem to be contemplations regarding the design and future of my original <a href="http://fate.multimedia.cx/">FATE system</a> and are thus ready for the recycle bin at this point. <a href="http://hardwarebug.org/">Mans</a> is a man of considerably fewer words, so I thought I would use a few words to describe the <a href="http://multimedia.cx/eggs/usurper-of-fate/">new FATE system that he put together</a>.</p>
<p><strong>Overview</strong><br />
Here are the distinguishing features that Mans mentioned in <a href="http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-July/094271.html">his announcement message</a>:</p>
<ul>
<li>Test specs are part of the ffmpeg repo.  They are thus properly versioned, and any developer can update them as needed.</li>
<li>Support for inexact tests.</li>
<li>Parallel testing on multi-core systems.</li>
<li>Anyone registered with FATE can add systems.</li>
<li>Client side entirely in POSIX shell script and GNU make.</li>
<li>Open source backend and web interface.</li>
<li>Client and backend entirely decoupled.</li>
<li>Anyone can contribute patches.</li>
</ul>
<p><strong>Client</strong><br />
The FATE build/test client source code is contained in tests/fate.sh in the FFmpeg source tree. The script -- as the extension implies -- is a shell script. It takes a text file full of shell variables, updates source code, configures, builds, and tests. It's a considerably minor amount of code, especially compared to my original Python code. Part of this is because most of the testing logic has shifted into FFmpeg itself. The build system knows about all the FATE tests and all of the specs are now maintained in the codebase (thanks to all who spearheaded that effort-- I think it was Vitor and Mans).</p>
<p>The client creates a report file which contains a series of lines to be transported to the server. The first line has some information about the configuration and compiler, plus the overall status of the build/test iteration. The second line contains './configure' information. Each of the remaining lines contain information about an individual FATE test, mostly in Base64 format. </p>
<p><strong>Server</strong><br />
The server source code lives at <a href="http://git.mansr.com/?p=fateweb">http://git.mansr.com/?p=fateweb</a>. It is written in Perl and plugs into a CGI-capable HTTP server. Authentication between the client and the server operates via SSH/SSL. In stark contrast to the original FATE server, there is no database component on the backend. The new system maintains information in a series of flat files.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/fate-under-new-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Usurper of FATE</title>
		<link>http://multimedia.cx/eggs/usurper-of-fate/</link>
		<comments>http://multimedia.cx/eggs/usurper-of-fate/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 05:06:08 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2619</guid>
		<description><![CDATA[Mans Rullgard has created a much better FATE]]></description>
			<content:encoded><![CDATA[<p><a href="http://hardwarebug.org/">Mans</a> sent a <a href="http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-July/094271.html">message to the FFmpeg-devel list</a> today:</p>
<blockquote><p>
<strong>A new FATE</strong></p>
<p>Mike's FATE system has done a great job over the last few years.  It<br />
is however beginning to prove inadequate in various ways:</p>
<p>[various shortcomings already dissected at length on this very blog]</p>
<p>To address the above-mentioned issues, I have been working on a<br />
replacement system which is now ready to be announced.
</p></blockquote>
<p>Check it out: <a href="http://fate.ffmpeg.org/">http://fate.ffmpeg.org/</a>.</p>
<p>Considering that he just obsoleted something I've poured a lot of time and energy into over the last 2.5 years, is my first reaction to this news supposed to be <strong>unbridled joy</strong>? Hey, I'm already <a href="http://multimedia.cx/eggs/asking-the-right-question/">on record as stating that I wouldn't mind throwing away all of FATE if there was a better alternative</a>.</p>
<p>I'm not certain but I'm pretty sure that at this point, the original <a href="http://fate.multimedia.cx/">FATE server</a> is practically obsolete. Mans is already testing all of his configurations as well as the configs I test. As soon as the other FATE installations switch over to the new server, I should be able to redirect fate.multimedia.cx -> fate.ffmpeg.org, sell most of my computers, and spend more time with my family.</p>
<p>Thanks, Mans!</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/usurper-of-fate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multiprocess FATE Revisited</title>
		<link>http://multimedia.cx/eggs/multiprocess-fate-revisited/</link>
		<comments>http://multimedia.cx/eggs/multiprocess-fate-revisited/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 03:47:58 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2586</guid>
		<description><![CDATA[More rambling about how I'm revising FATE's process runner]]></description>
			<content:encoded><![CDATA[<p>I thought I had <a href="http://multimedia.cx/eggs/fate-process-multi-runner/">brainstormed a simple, elegant, multithreaded, deadlock-free refactoring for FATE in a previous post</a>. However, I sort of glossed over the test ordering logic which I had not yet prototyped. The grim, possibly deadlock-afflicted reality is that the main thread needs to be notified as tests are completed. So, the main thread sends test specs through a queue to be executed by <em>n</em> tester threads and those threads send results to a results aggregator thread. Additionally, the results aggregator will need to send completed test IDs back to the main thread.</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/06/3-fate-threads-300x259.png" alt="" title="3 FATE threads" width="300" height="259" class="aligncenter size-medium wp-image-2589" /><br />
</center></p>
<p>But when I step back and look at the graph, I can't rationalize why there should be a separate results aggregator thread. That was added to cut down on deadlock possibilities since the main thread and the tester threads would not be waiting for data from each other. Now that I've come to terms with the fact that the main and the testers need to exchange data in realtime, I think I can safely eliminate the result thread. Adding more threads is not the best way to guard against race conditions and deadlocks. Ask <a href="http://xine-project.org/">xine</a>.</p>
<p><center><br />
<img src="http://multimedia.cx/eggs/wp-content/uploads/2010/06/2-fate-threads.png" alt="" title="2 FATE threads" width="164" height="264" class="aligncenter size-full wp-image-2590" /><br />
</center></p>
<p><span id="more-2586"></span></p>
<p>I'm still hung up on the deadlock issue. I have these queues through which the threads communicate. At issue is the fact that they can cause a thread to block when inserting an item if the queue is "full". How full is full? Immaterial; seeking to answer such a question is not how you guard against race conditions. Rather, it seems to me that one side should be doing non-blocking queue operations.</p>
<p>This is how I'm planning to revise the logic in the main thread:</p>
<pre>
test_set = set of all tests to execute
tests_pending = test_set
tests_blocked = empty set
tests_queue = multi-consumer queue to send test specs to tester threads
results_queue = multi-producer queue through which tester threads send results
while there are tests in tests_pending:
  pop a test from test_set
  if test depends on any tests that appear in tests_pending:
    add test to tests_blocked
  else:
    add test to tests_queue in a non-blocking manner
    if tests_queue is full, add test to tests_blocked

  while there are results in the results_queue:
    get a result from result_queue in non-blocking manner
    remove the corresponding test from tests_pending

if tests_blocked is non-empty:
  sleep for 1 second
  test_set = tests_blocked
  tests_blocked = empty set
else:
  insert <em>n</em> shutdown signals, one from each thread

go to the top of the loop and repeat until there are no more tests

while there are results in the results_queue:
  get a result from result_queue in a blocking manner
</pre>
<p>Not mentioned in the pseudocode (so it doesn't get too verbose) is logic to check whether the retrieved test result is actually an end-of-thread signal. These are accounted and the whole test process is done when one is received for each thread.</p>
<p>On the tester thread side, it's safe for them to do blocking test queue retrievals and blocking result queue insertions. The reason for the 1-second delay before resetting tests_blocked and looping again is because I want to guard against the situation where tests A and B are to be run, A depends of B running first, and while B is running (and happens to be a long encoding test), the main thread is spinning about, obsessively testing whether it's time to insert A into the tests queue.</p>
<p>It all sounds just crazy enough to work. In fact, I coded it up and it does work, sort of. The queue gets blocked pretty quickly. Instead of sleeping, I decided it's better to perform the put operation using a 1-second timeout.</p>
<p>Still, I'm paranoid about the precise operation of the IPC queue mechanism at work here. What happens if I try to stuff in a test spec that's a bit too large? Will the module take whatever I give it and serialize it through the queue as soon as it can? I think an impromptu science project is in order.</p>
<p>big-queue.py:</p>
<div class="igBar"><span id="lpython-2"><a href="#" onclick="javascript:showPlainTxt('python-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PYTHON:</span>
<div id="python-2">
<div class="python">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">import</span> multiprocessing</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">Queue</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">def</span> f<span style="color: black;">&#40;</span>q<span style="color: black;">&#41;</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #008000;">str</span> = q.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">"reader function got a string of %d characters"</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">q = multiprocessing.<span style="color: #dc143c;">Queue</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">p = multiprocessing.<span style="color: black;">Process</span><span style="color: black;">&#40;</span>target=f, args=<span style="color: black;">&#40;</span>q,<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">p.<span style="color: black;">start</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">try</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; q.<span style="color: black;">put_nowait</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'a'</span> * <span style="color: #ff4500;color:#800000;">100000000</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #dc143c;">Queue</span>.<span style="color: black;">Full</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">"queue full"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<pre>
$ ./big-queue.py
reader function got a string of 100000000 characters
</pre>
<p>Since 100 MB doesn't even make it choke, FATE's little test specs shouldn't pose any difficulty.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/multiprocess-fate-revisited/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Revised FATE Test Spec System</title>
		<link>http://multimedia.cx/eggs/revised-fate-test-spec-system/</link>
		<comments>http://multimedia.cx/eggs/revised-fate-test-spec-system/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 05:48:45 +0000</pubDate>
		<dc:creator>Multimedia Mike</dc:creator>
				<category><![CDATA[FATE Server]]></category>

		<guid isPermaLink="false">http://multimedia.cx/eggs/?p=2552</guid>
		<description><![CDATA[FATE's test system will be the next piece to get overhauled]]></description>
			<content:encoded><![CDATA[<p><a href="http://fate.multimedia.cx/">FATE</a> involves some database tables that define the <a href="http://fate.multimedia.cx/index.php?list_test_specs=1">test specifications</a>. Like everything else in FATE, the concept could use some improvement. After I <a href="http://multimedia.cx/eggs/fate-process-multi-runner/">prototyped an improved, multithreaded testing client</a>, the next logical revision seemed to be the test spec system.</p>
<p><strong>History</strong><br />
The test spec system has been handled by a single table that includes an FFmpeg command line (with a few possible modifiers thrown in), an integer ID, a human-friendly ID, a description, the expected command line return code, the expected command output, a maximum runtime, and a Boolean to indicate whether the test is to be considered active.</p>
<p>Adjunct to this test database is a large corpus of test media named the FATE suite.</p>
<p>At first, the FATE testing script used a direct MySQL database protocol to query the test specs from the server before every build/test cycle. I soon realized this was ludicrously inefficient since the test specs don't change that often. So I cached the tests in a static file to be retrieved via HTTP, first in Python's "pickled" (serialized) format, then in an SQLite database.</p>
<p><strong>Planned Upgrades</strong><br />
There are 2 major features I would like to build into the system going forward:</p>
<ol>
<li>The ability to version the entire suite so that it's possible to test old branches of FFmpeg</li>
<li>Another database field to indicate which, if any, other test specs must be executed before this spec can be executed</li>
</ol>
<p>I think I will take this opportunity to switch the test cache serialization format to JSON. I switched from Python pickling to SQLite because the latter was more portable between languages. JSON has that same benefit. Further, working with JSON data doesn't require a round trip to disk (i.e., want to generate an SQLite database for sending via HTTP? It needs to go onto disk first. It's possible to create and manipulate a database entirely in memory but not fetch the bits).</p>
<p><strong>Things To Research</strong></p>
<ul>
<li>Pondering how version control systems operate and what they have to teach regarding how to version this data (<strong>including the question of whether I can just use an existing version control mechanism instead of creating my own system</strong>)</li>
<li>Efficient caching mechanism</li>
<li>Tagging test specs for alternate purposes such as longevity testing</li>
<li>Learn about web form programming in the 21st century so that it's not quite as painful to maintain the system.</li>
</ul>
<p><strong>Preliminary Versioning Concept</strong><br />
Here is one approach I am thinking of: Create test groups. Each test spec is assigned to at least one test group. I can think of at least 2 groups: functional (the base test set in existence that validates functionality) and profiling (the projected test set that will be used for ongoing performance and memory profiling). The web frontend will allow for the creation of labels that will apply to a single group. Doing so will apply that label to all active tests in the group.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimedia.cx/eggs/revised-fate-test-spec-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

