<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: obi chinedu frank</title>
    <description>The latest articles on DEV Community by obi chinedu frank (@frankieme1).</description>
    <link>https://dev.to/frankieme1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F77097%2Fb39c18d0-1dc5-4f58-9364-062a250fb6da.jpeg</url>
      <title>DEV Community: obi chinedu frank</title>
      <link>https://dev.to/frankieme1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/frankieme1"/>
    <language>en</language>
    <item>
      <title>Our '1 in 3 billion' hash collision showed up on seed 6</title>
      <dc:creator>obi chinedu frank</dc:creator>
      <pubDate>Thu, 05 Nov 2026 13:22:48 +0000</pubDate>
      <link>https://dev.to/frankieme1/our-1-in-3-billion-hash-collision-showed-up-on-seed-6-15ei</link>
      <guid>https://dev.to/frankieme1/our-1-in-3-billion-hash-collision-showed-up-on-seed-6-15ei</guid>
      <description>&lt;p&gt;We wrote a comment in our code saying the chance of a hash collision was about 3 × 10⁻¹⁰ per run. The hash was 64 bits, there were 100,000 names, and the birthday arithmetic was correct.&lt;/p&gt;

&lt;p&gt;Then a teammate generated a dataset with a new seed, and two names collided in all 64 bits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Dacom Mina" -&amp;gt; 0x916714a150607c41
"Dacom Maca" -&amp;gt; 0x916714a150607c41
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That was the most useful thing we learned in &lt;a href="https://speeddemon.dev" rel="noopener noreferrer"&gt;Speed Demon 2026&lt;/a&gt;, a 72-hour performance hackathon run by &lt;a href="https://raptors.dev/" rel="noopener noreferrer"&gt;Hackathon Raptors&lt;/a&gt;. Four tasks, each with a slow Python reference, and you are scored on time, peak memory and code size on a fixed machine: an i5-13500 with 6 cores and 12 threads, turbo off.&lt;/p&gt;

&lt;p&gt;Three of us entered as Deez-attacher: me, dannyamah and realist. We wrote Rust with zero dependencies and used Claude Code heavily. Some of the mistakes below are ones it made and I accepted. The code and every measurement are in &lt;a href="https://github.com/FrankChinedu/speed-demon" rel="noopener noreferrer"&gt;the repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is where we ended on the public board at code freeze. Final scores, on a seed nobody has seen, aren't out yet.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Track&lt;/th&gt;
&lt;th&gt;Reference&lt;/th&gt;
&lt;th&gt;Our best run&lt;/th&gt;
&lt;th&gt;Speedup&lt;/th&gt;
&lt;th&gt;Peak memory&lt;/th&gt;
&lt;th&gt;Rank&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A: log ingest&lt;/td&gt;
&lt;td&gt;32.05 s&lt;/td&gt;
&lt;td&gt;0.026 s&lt;/td&gt;
&lt;td&gt;1,222x&lt;/td&gt;
&lt;td&gt;21 MB&lt;/td&gt;
&lt;td&gt;37 of 134&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B: text index&lt;/td&gt;
&lt;td&gt;56.35 s&lt;/td&gt;
&lt;td&gt;0.238 s&lt;/td&gt;
&lt;td&gt;237x&lt;/td&gt;
&lt;td&gt;44 MB&lt;/td&gt;
&lt;td&gt;31 of 104&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C: CSV join&lt;/td&gt;
&lt;td&gt;14.44 s&lt;/td&gt;
&lt;td&gt;0.040 s&lt;/td&gt;
&lt;td&gt;361x&lt;/td&gt;
&lt;td&gt;11 MB&lt;/td&gt;
&lt;td&gt;41 of 111&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D: shortest paths&lt;/td&gt;
&lt;td&gt;72.69 s&lt;/td&gt;
&lt;td&gt;0.194 s&lt;/td&gt;
&lt;td&gt;375x&lt;/td&gt;
&lt;td&gt;125 MB&lt;/td&gt;
&lt;td&gt;44 of 113&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Solidly mid-table. The leaders ran A and C in 0.014 s. So read this as a list of what cost us time, not a recipe for winning.&lt;/p&gt;

&lt;h2&gt;
  
  
  The collision: odds that were never real
&lt;/h2&gt;

&lt;p&gt;To count distinct names per country in track C, we identified each name by a hash and never compared bytes. That change took the track from 0.069 s to 0.060 s. The hash was an FxHash-style step over 8-byte words, followed by the MurmurHash3 finaliser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;mix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="nf"&gt;.rotate_left&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.wrapping_mul&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0x517c_c1b7_2722_0a95&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is how two names defeat it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Dacom Mi&lt;/code&gt; and &lt;code&gt;Dacom Ma&lt;/code&gt; differ only in their last byte. &lt;code&gt;i ^ a&lt;/code&gt; is &lt;code&gt;0x08&lt;/code&gt;, so the two words differ only at bit 59.&lt;/li&gt;
&lt;li&gt;Multiplying can only carry a difference upward, so after the multiply the two states differ only in their top five bits.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rotate_left(5)&lt;/code&gt; moves those five bits to the bottom of the word, exactly where the next word's first byte gets XORed in.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;n ^ c&lt;/code&gt; happens to equal that difference, it cancels, and the two states are now identical.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The finaliser can't help, because it is a bijection: equal inputs stay equal.&lt;/p&gt;

&lt;p&gt;I reproduced this in Python. Take two 10-byte names that share their first seven bytes, set the eighth to &lt;code&gt;i&lt;/code&gt; and &lt;code&gt;a&lt;/code&gt;, and try every lowercase letter for the ninth: &lt;strong&gt;about 1 pair in 35 collides&lt;/strong&gt; (15,034 of 520,000). In 200,000 pairs of random names, none did.&lt;/p&gt;

&lt;p&gt;The 3 × 10⁻¹⁰ figure assumed the hash behaved randomly, on input that was anything but random. Names in this dataset are built from a shared vocabulary, so near-duplicates are common.&lt;/p&gt;

&lt;p&gt;Every check we had passed: the board's seed, plus our seeds 2 and 3. realist found it by adding seeds 4 to 7, and C undercounted distinct names on seed 6 only. Final scoring runs on an unseen seed and every run must be correct, so this could have zeroed the track. The fix was a folded multiply (a 64×64→128-bit multiply with the halves XORed together), tested with zero collisions on 2.9 million deliberately near-duplicate names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I'd do differently:&lt;/strong&gt; a collision probability is a claim about your hash, so test it on the nastiest input you can build before you believe the number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three benchmarks, each blind to something different
&lt;/h2&gt;

&lt;p&gt;We ended up with three ways of measuring, and every one of them misled us.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Good at&lt;/th&gt;
&lt;th&gt;Blind to&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Local Mac (M1, arm64)&lt;/td&gt;
&lt;td&gt;Correctness&lt;/td&gt;
&lt;td&gt;x86 code paths, and cache pressure: its L2 is about ten times the scoring box's&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The scoring board&lt;/td&gt;
&lt;td&gt;Being the truth&lt;/td&gt;
&lt;td&gt;Anything under about ±8%: the same code on D measured 0.196 to 0.241 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GitHub Actions x86 runner, 15+ alternating runs&lt;/td&gt;
&lt;td&gt;Small compute changes, with a confidence interval&lt;/td&gt;
&lt;td&gt;Contention: it has 2 vCPUs, not 12 threads&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each blind spot cost us something real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Mac hid a third of track B's corpus pass.&lt;/strong&gt; A counting sort cost about 5 ns per posting locally and about 48 ns on the box. It scattered writes across 53,000 per-term cursors, which fits in the Mac's L2 and misses constantly in 1.25 MB shared by two hyperthreads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The board made us throw away real wins.&lt;/strong&gt; I rejected an AVX2 endpoint scan because a single board run showed about 2%. Later, the A/B runner measured a similar scan at 1.055x (95% CI 1.049 to 1.059). dannyamah reverted a D change after two noisy samples, then restored it when A/B measured 1.073x.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The runner couldn't see contention.&lt;/strong&gt; Some of its wins vanished on the box and were reverted. The reverse also happened, as the next section shows.&lt;/p&gt;

&lt;p&gt;The A/B tool (&lt;a href="https://github.com/FrankChinedu/speed-demon/blob/speed-demon/dev/tools/ab.py" rel="noopener noreferrer"&gt;&lt;code&gt;dev/tools/ab.py&lt;/code&gt;&lt;/a&gt;) arrived on the last full day, and I wish we'd had it on the first. It alternates two binaries in ABBA order so that drift hits both equally, and reports a bootstrap interval. Our rule became: compute changes go through A/B, and anything about threads or memory goes to the board.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lock we tested for and wrongly ruled out
&lt;/h2&gt;

&lt;p&gt;Removing the endpoint lookup from track A's parser saved about 9 ms, which works out to around 100 cycles per lookup on a 64 KB thread-local table. That is far too slow for a table in cache.&lt;/p&gt;

&lt;p&gt;A shared registry sat behind that table, behind a mutex, taken only the first time each thread met a name. All 12 threads start on the same part of the file and meet the same names at once. So I suspected the lock, and tested thread-local ids with no registry. It came back slower twice, at 0.0432 and 0.0435 s against 0.0396. I crossed the lock off.&lt;/p&gt;

&lt;p&gt;That was the wrong conclusion, for two reasons. Unchanged code later measured 0.0432 on the same board, so my evidence was inside the noise. And my replacement added a rank lookup per record, so I hadn't tested "no lock". I had tested "no lock, plus new work".&lt;/p&gt;

&lt;p&gt;realist later replaced the registry with one lock-free table shared by all threads. &lt;strong&gt;Parsing went from 28.5 ms to 19.9 ms.&lt;/strong&gt; That is contention the 2-vCPU runner can't see at all.&lt;/p&gt;

&lt;p&gt;Track D had a lock bug of its own, and this one is worth checking for in your own Rust:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Holds the lock for the whole loop body: temporaries in a&lt;/span&gt;
&lt;span class="c1"&gt;// `while let` scrutinee live until the end of the body.&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nf"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;work&lt;/span&gt;&lt;span class="nf"&gt;.lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.next&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;fill_bucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="cm"&gt;/* ... */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Holds it only to pick the next bucket.&lt;/span&gt;
&lt;span class="k"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nf"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;work&lt;/span&gt;&lt;span class="nf"&gt;.lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.next&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nf"&gt;fill_bucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="cm"&gt;/* ... */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our "parallel" build was running one bucket at a time. Together with a smaller distance-map entry in the same commit, the fix took D from 0.246 s to 0.193 s.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timing probes: wrong answers on purpose
&lt;/h2&gt;

&lt;p&gt;The board has no profiler, but it reports time and memory even when your output is wrong. So we committed versions that write an empty file and exit after a given phase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nn"&gt;std&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="nf"&gt;.join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"summary.txt"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s"&gt;b""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// TIMING PROBE&lt;/span&gt;
&lt;span class="nn"&gt;std&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;process&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every push ran all four tracks, so one board slot could carry a probe on one track and an experiment on another. We logged 42 probe runs over the event. Subtracting probes against each other told us where B's time went, on the real hardware:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Probe exits after&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tokenizing only&lt;/td&gt;
&lt;td&gt;168 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+ collecting postings&lt;/td&gt;
&lt;td&gt;177 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+ phrase matching&lt;/td&gt;
&lt;td&gt;188 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+ the per-chunk sort&lt;/td&gt;
&lt;td&gt;272 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No local profile had made that 84 ms sort look like a problem. My fix, scattering one term range at a time, recovered only about 22 ms of it, but we'd never have looked there otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two-line change
&lt;/h2&gt;

&lt;p&gt;This is a realist find in track C. Every record checked for a byte order mark:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// before&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nf"&gt;.starts_with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BOM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="c1"&gt;// after: every byte but a BOM's is ASCII (spec 2.2), so 0xEF at a record start is one&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;BOM&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three bytes, a &lt;code&gt;memcmp&lt;/code&gt; call, 3.3 million times. &lt;strong&gt;1.080x on the A/B runner&lt;/strong&gt;, the largest single compute win on that track. It works because the spec guarantees everything else is ASCII, so the first byte is enough. Reading the spec closely found more speed than most of our SIMD did.&lt;/p&gt;

&lt;h2&gt;
  
  
  The optimisation that failed, then won
&lt;/h2&gt;

&lt;p&gt;On day two I tried summarising query results in bulk, with a popcount per bitmap word and six masked popcounts for the sum of bit positions, and only the first ten ids handled one by one. The board said 0.319 s against 0.314 s, so I reverted it.&lt;/p&gt;

&lt;p&gt;The next day, dannyamah tried the same idea and measured &lt;strong&gt;1.074x (CI 1.071 to 1.077)&lt;/strong&gt;. In between, the threshold for turning a term into a bitmap had moved from 1/16 of a chunk to 1/64. Far more result data was in bitmaps now, so the code path I'd tested on barely-used data had become the hot one.&lt;/p&gt;

&lt;p&gt;A reverted experiment only tells you about the code as it was that day. We kept every failure in &lt;a href="https://github.com/FrankChinedu/speed-demon/blob/speed-demon/track-b/PERF.md" rel="noopener noreferrer"&gt;&lt;code&gt;PERF.md&lt;/code&gt;&lt;/a&gt;, 37 labelled in the run log, and that record is how an old idea got a second look.&lt;/p&gt;

&lt;h2&gt;
  
  
  Freeing memory is a multi-core event
&lt;/h2&gt;

&lt;p&gt;Track A freed about 860 record blocks one at a time. Each &lt;code&gt;munmap&lt;/code&gt; is a TLB shootdown that interrupts every core. Reserving one mapping per hour and returning it with a single &lt;code&gt;munmap&lt;/code&gt; took the run from 0.033 s to 0.028 s, without changing any of the actual work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we never figured out
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;About 24 MB on B and D.&lt;/strong&gt; The box charged us that much more than our arrays explain. It wasn't thread stacks, and one malloc arena saved only 3.7 MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Returning memory on D.&lt;/strong&gt; Giving back the build's edge arrays with &lt;code&gt;madvise&lt;/code&gt; raised the peak from 160 MB to 233 MB, even at 2 MB granularity. I suspect transparent huge pages, but we never proved it. Smaller rows are what finally brought it down to 125 MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How the leaders did it.&lt;/strong&gt; The top team ran D in 0.061 s against our 0.194 s. A profile puts 22% of our run in distance-map probes. We never tried goal-directed search, which is my best guess, and it is only a guess.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  If you only keep three things
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Test your hash on adversarial near-duplicates. The birthday bound assumes randomness you may not have.&lt;/li&gt;
&lt;li&gt;Know what your benchmark can't see. A 2-vCPU runner can't see contention, a laptop can't see the target's cache, and one noisy sample can't see 5%.&lt;/li&gt;
&lt;li&gt;Log your failures with their numbers, and retest them when the code around them changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Everything is public: &lt;a href="https://github.com/FrankChinedu/speed-demon" rel="noopener noreferrer"&gt;the repo&lt;/a&gt;, with a &lt;code&gt;PERF.md&lt;/code&gt; per track listing every board run, probe and reverted experiment. Thanks to &lt;a href="https://raptors.dev/" rel="noopener noreferrer"&gt;Hackathon Raptors&lt;/a&gt; for running it. Final results come out November 13, and I'll find out then whether our hash survives a seed it has never seen.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>performance</category>
      <category>hashing</category>
      <category>programming</category>
    </item>
    <item>
      <title>Rankings with receipts: what building a hackathon judging platform taught us</title>
      <dc:creator>obi chinedu frank</dc:creator>
      <pubDate>Wed, 07 Oct 2026 13:24:32 +0000</pubDate>
      <link>https://dev.to/frankieme1/rankings-with-receipts-what-building-a-hackathon-judging-platform-taught-us-1og1</link>
      <guid>https://dev.to/frankieme1/rankings-with-receipts-what-building-a-hackathon-judging-platform-taught-us-1og1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F99wji544k9czd9nxr00e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F99wji544k9czd9nxr00e.png" alt="Cover for " width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DOGFOOD 2026 had a theme that sounds like a joke until you try it: &lt;strong&gt;build the platform that will judge you.&lt;/strong&gt; Every team builds a hackathon portal. The organisers then run their checker against it, and the portals themselves become the thing being judged.&lt;/p&gt;

&lt;p&gt;We built &lt;strong&gt;&lt;a href="https://github.com/Len3hq/evenhand" rel="noopener noreferrer"&gt;Evenhand&lt;/a&gt;&lt;/strong&gt;: a self-hosted portal where teams submit to a public gallery, judges score against a weighted rubric, and organisers publish rankings that are corrected for harsh and generous judges. Each ranking comes with a receipt.&lt;/p&gt;

&lt;p&gt;The spec had a few hard rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker compose up&lt;/code&gt; has to bring up a &lt;strong&gt;working, seeded portal with the network off&lt;/strong&gt;. No cloud accounts, no hosted database, no external API.&lt;/li&gt;
&lt;li&gt;The organisers ship a &lt;code&gt;fixtures.json&lt;/code&gt; of 41 projects, 29 judges and 121 reviews. It has traps planted in it.&lt;/li&gt;
&lt;li&gt;A checker (&lt;code&gt;run.py&lt;/code&gt;) makes curl-style requests against your portal. The check the spec calls "the one that matters most" asks: &lt;strong&gt;can judge B read judge A's scores?&lt;/strong&gt; The answer has to be no.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We used NestJS, Next.js, Prisma 7 and PostgreSQL 16, in three containers with one public port. Below are four things we learned. Each one is something we only understood by building it.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The architecture decision that shaped everything: the API is the only authority, and the network enforces it
&lt;/h2&gt;

&lt;p&gt;Early on we wrote one sentence on the whiteboard, and it settled most later arguments:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;If I can curl another judge's scores, it is not isolation.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hackathon portals usually hide things in the UI. The judge page doesn't render other judges' scores, so they look private. But the checker never opens a browser. It sends HTTP requests. So we decided that &lt;strong&gt;every rule lives in the API&lt;/strong&gt;, and the Next.js app is just one more client with no more trust than curl.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;           browser                     curl / run.py / scripts
              │ cookie: session              │ Authorization: Bearer &amp;lt;token&amp;gt;
              ▼                              ▼
 ┌──────────────────────────── edge network ────────────────────────────┐
 │  web  :8080   Next.js  ── the only published port                     │
 │               /api/* is proxied to the api                            │
 └───────────────┬───────────────────────────────────────────────────────┘
                 │  backend network (internal: no route to the internet)
 ┌───────────────▼───────────────────────────────────────────────────────┐
 │  api  :3001   NestJS                                                   │
 │    ThrottlerGuard → SessionGuard → RoleGuard → route guards → DTOs     │
 │    @evenhand/judging-engine (pure TS, zero dependencies)               │
 │  db   :5432   PostgreSQL 16                                            │
 └────────────────────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one decision drove four others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deny first, before touching the database.&lt;/strong&gt; If a judge asks for &lt;code&gt;/api/judges/jdg_24/scores&lt;/code&gt; and they aren't jdg_24, the API refuses before it checks whether jdg_24 exists. A real judge and a made-up one get the same &lt;code&gt;403&lt;/code&gt;. If you check existence first and return &lt;code&gt;404&lt;/code&gt; for unknown judges, an attacker can list your judges from the outside. The whole permission matrix (visitor, participant, judge, organiser, admin, against own scores, peer scores, another event, CSV, audit log) is one end-to-end test that runs on every change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One origin.&lt;/strong&gt; Next.js rewrites &lt;code&gt;/api/*&lt;/code&gt; to the NestJS container, so the browser, curl and the checker all use &lt;code&gt;http://localhost:8080&lt;/code&gt;. Cookies stay same-origin, there's no CORS to configure, and the checker needs only one &lt;code&gt;base_url&lt;/code&gt;. Remember this choice, because it caused section 2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"No network" is built into the topology instead of left to discipline.&lt;/strong&gt; &lt;code&gt;db&lt;/code&gt; and &lt;code&gt;api&lt;/code&gt; sit only on an internal Docker network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;internal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;   &lt;span class="c1"&gt;# no route to the internet&lt;/span&gt;
  &lt;span class="na"&gt;edge&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;api&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;web&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;edge&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;   &lt;span class="c1"&gt;# the only container that can be reached&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;8080:8080'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If someone adds an npm package that phones home, it fails immediately with &lt;code&gt;EAI_AGAIN&lt;/code&gt;, in development as well as in CI, so we never have to remember to test offline. It also caught something we didn't know about. The Prisma CLI runs &lt;code&gt;migrate deploy&lt;/code&gt; on every container start, and it was trying to report its version to &lt;code&gt;checkpoint.prisma.io&lt;/code&gt;. The internal network blocked it, and we set &lt;code&gt;CHECKPOINT_DISABLE=1&lt;/code&gt; so it stops trying. CI also runs an &lt;strong&gt;offline drill&lt;/strong&gt;: clone the repo, build with the network on, then start on empty volumes with every network internal and run the organisers' checker and our browser tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The maths that decides who wins is a pure library.&lt;/strong&gt; &lt;code&gt;src/judging-engine&lt;/code&gt; has no dependencies, no database and no clock. It takes reviews as input and returns rankings. Rows are summed in a fixed order, so results are identical bit for bit whatever order the reviews arrive in. That made section 3 possible: we could test the algorithm against thousands of synthetic events in milliseconds, and we could generate a proof document from the code and &lt;strong&gt;fail the build if the committed proof differs from what the code computes today.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Docker gotcha: the proxy that made every user the same person
&lt;/h2&gt;

&lt;p&gt;This bug wasn't in a Dockerfile. It came from the network layout.&lt;/p&gt;

&lt;p&gt;We had rate limits on everything: logins, exports, review saves, comments, votes. They were tested and they worked. NestJS's throttler keys limits by client address by default, which is the obvious choice.&lt;/p&gt;

&lt;p&gt;Then we ran a live test against the &lt;strong&gt;full Docker stack&lt;/strong&gt; instead of the API alone, and saw this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;21 bad bearer tokens from anyone locked out every user for the rest of the minute, admins included.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Eleven different people logging in within one minute:&lt;/strong&gt; the 10th and 11th got &lt;code&gt;429 Too Many Requests&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Exports, review saves, comments and votes were each one allowance &lt;strong&gt;shared by the whole event.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cause was the "one origin" decision from section 1. Every browser request reaches the API through the Next.js container, so &lt;strong&gt;the API sees one IP address for every user.&lt;/strong&gt; Keying limits by IP behind your own proxy turns "per user" into "for everyone." A limit meant to stop one person brute-forcing tokens became a way for one person to take the event offline.&lt;/p&gt;

&lt;p&gt;It got worse. The API trusted &lt;code&gt;X-Forwarded-For&lt;/code&gt; from the web container, and the web container passed on whatever the client sent. So an attacker could also &lt;strong&gt;choose&lt;/strong&gt; the address the API saw, and get past the per-address login limit by changing a header.&lt;/p&gt;

&lt;p&gt;The fix was to key limits by &lt;strong&gt;who&lt;/strong&gt; is calling instead of &lt;strong&gt;where&lt;/strong&gt; the request comes from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;rateLimitTracker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TrackedRequest&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;authorization&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bearer &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`token:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;hashToken&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bearer &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;())}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`session:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;hashToken&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// ...personal voting links get their own bucket too&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`ip:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ip&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;unknown&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// only anonymous requests share the address&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two more rules came with it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Login and registration are limited per email&lt;/strong&gt;, not per address. Guessing one account's password stays at 10 tries a minute however the attacker varies &lt;code&gt;X-Forwarded-For&lt;/code&gt;, and people signing in at the same moment don't use up each other's attempts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The failed-credential limiter refuses only failing requests.&lt;/strong&gt; After 20 failures in a minute from an address, further bad tokens get &lt;code&gt;429&lt;/code&gt; instead of &lt;code&gt;401&lt;/code&gt;, but a &lt;strong&gt;valid credential always gets through.&lt;/strong&gt; Tokens are random 256-bit values, so letting a correct one through tells an attacker nothing. The limiter slows guessing down; the token entropy is what actually protects accounts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trade-off is written down: someone who knows your email can use up your logins for a minute. Sessions that are already open are unaffected. That's a much smaller problem than one person locking out a whole hackathon during judging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; if your app sits behind a reverse proxy you ship yourself, every IP-keyed control in it is suspect. Test rate limits through the real network path, not against the bare service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smaller Docker problems that also cost us time
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CRLF in the entrypoint.&lt;/strong&gt; Git on Windows checks files out with CRLF line endings by default. &lt;code&gt;docker/api-entrypoint.sh&lt;/code&gt; gets copied into the image with &lt;code&gt;#!/bin/sh\r&lt;/code&gt; as its first line, and the container fails with &lt;code&gt;exec /usr/local/bin/api-entrypoint.sh: no such file or directory&lt;/code&gt;. The file is there; the error is really about the interpreter &lt;code&gt;/bin/sh\r&lt;/code&gt;, which doesn't exist. We fixed it twice: &lt;code&gt;* text=auto eol=lf&lt;/code&gt; in &lt;code&gt;.gitattributes&lt;/code&gt;, and a &lt;code&gt;sed -i 's/\r$//'&lt;/code&gt; in the Dockerfile for copies that arrive from a zip or an editor. LF everywhere also keeps Prisma's migration checksums identical across machines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prisma chooses its engine binary by the OpenSSL version it finds at install time.&lt;/strong&gt; If the build stage and the runtime stage see different OpenSSL versions, the runtime tries to &lt;strong&gt;download&lt;/strong&gt; a matching engine on startup. Online you'd never notice. Offline it fails. Every stage now shares one base image with OpenSSL installed, and the build fails early if the OpenSSL 3 engine is missing:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;  RUN ls node_modules/@prisma/engines/schema-engine-*openssl-3.0.x &amp;gt;/dev/null \
   || { echo "Prisma schema engine for OpenSSL 3 missing: runtime would try to download it" &amp;gt;&amp;amp;2; exit 1; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js rewrites are fixed at build time.&lt;/strong&gt; Setting the API address as a runtime environment variable does nothing for &lt;code&gt;rewrites()&lt;/code&gt;; it has to be a build &lt;code&gt;ARG&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A fresh CI runner has no cached images.&lt;/strong&gt; The offline step starts with &lt;code&gt;--pull never&lt;/code&gt;, so the drill has to pull the pinned Postgres image while the network is still on.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. The scoring algorithm we almost shipped
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The textbook answer
&lt;/h3&gt;

&lt;p&gt;The spec asks for "cross-judge normalization, with the method documented." The usual method is &lt;strong&gt;per-judge z-scores&lt;/strong&gt;: subtract each judge's mean, divide by their standard deviation, then average per project. It's in every "how to run a hackathon" guide, it's about 10 lines of code, and it's broken in two ways that the fixtures happen to expose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Break 1: it divides by zero.&lt;/strong&gt; The fixtures include &lt;code&gt;jdg_07&lt;/code&gt;, who gave &lt;strong&gt;4/4/4 to every project they reviewed&lt;/strong&gt;: a flat judge. Their standard deviation is 0, so their z-score is undefined. Two more judges have only one review each, so their SD is also 0. And &lt;code&gt;jdg_19&lt;/code&gt;'s three reviews happen to average exactly the same. With z-scores, &lt;strong&gt;four judges' reviews silently disappear.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Break 2: it assumes every judge saw projects of average quality.&lt;/strong&gt; That's only true if judges are assigned at random. Ours aren't: judges are matched to tracks. Suppose one track is stronger than another. The judge who sees only strong projects gives high scores because the projects are good, and z-scoring takes that away from them. &lt;strong&gt;The z-score can't tell "this judge is generous" from "this judge saw good projects."&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What we built instead
&lt;/h3&gt;

&lt;p&gt;We estimate every project's quality and every judge's leniency &lt;strong&gt;jointly&lt;/strong&gt;, from the full record of who reviewed what:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s_pj = μ + q_p + b_j + ε

minimise  Σ (s_pj − μ − q_p − b_j)²  +  λ_b Σ b_j²  +  λ_q Σ q_p²
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;q_p&lt;/code&gt; is project quality and &lt;code&gt;b_j&lt;/code&gt; is judge leniency. The ridge penalties pull both towards zero when there's little evidence. (This is equivalent to Gaussian priors on both, the approach from Roos, Rothe &amp;amp; Scheuermann, AAAI 2011.) It's solved exactly with a hand-written Cholesky factorisation inside the pure engine.&lt;/p&gt;

&lt;p&gt;This model doesn't need either z-score assumption:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A flat judge's offset is absorbed by &lt;code&gt;b̂&lt;/code&gt;, and &lt;strong&gt;nothing divides by their spread.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A judge with one review is shrunk towards zero, because one score says little about a judge.&lt;/li&gt;
&lt;li&gt;A project with two reviews is shrunk towards the mean and &lt;strong&gt;shown with a wider uncertainty.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A judge who reviews in two tracks acts as a bridge, so the model can compare those tracks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;We don't choose the λs; the data does.&lt;/strong&gt; They're picked by leave-one-review-out prediction error, computed exactly from the hat matrix (&lt;code&gt;e_i / (1 − h_ii)&lt;/code&gt;), and a test checks that against real refits. The grid we planned (0.25 to 8) turned out too narrow: on the fixtures, the error was still falling at 8. We widened it to 0.125–64, and the result now carries an &lt;code&gt;atEdge&lt;/code&gt; flag so a choice clipped by the grid is reported instead of passing silently.&lt;/p&gt;

&lt;p&gt;On &lt;strong&gt;20 seeded synthetic events&lt;/strong&gt; with a known true ranking (40 projects, 5 tracks of different strength, 30 judges):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Mean Spearman ρ vs truth&lt;/th&gt;
&lt;th&gt;With harsher judges&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Joint ridge model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.92&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.90&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Raw mean&lt;/td&gt;
&lt;td&gt;0.90&lt;/td&gt;
&lt;td&gt;0.77&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Per-judge z-score&lt;/td&gt;
&lt;td&gt;0.74&lt;/td&gt;
&lt;td&gt;0.74&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On the synthetic data, z-scores did worse than doing nothing.&lt;/p&gt;

&lt;h3&gt;
  
  
  The finding we didn't expect: the fixtures contain almost no signal
&lt;/h3&gt;

&lt;p&gt;On the organisers' real fixture data, the model predicts a held-out review only &lt;strong&gt;0.9% better&lt;/strong&gt; than predicting the overall mean. Who judged a project, and which project it was, explain very little of any single score.&lt;/p&gt;

&lt;p&gt;We have direct evidence for this. One team submitted the same project twice (more on that in section 4), and three judges scored both copies. &lt;strong&gt;The same judges, scoring the same project, disagreed with themselves by 1.11 points on average&lt;/strong&gt; on a 1–5 scale.&lt;/p&gt;

&lt;p&gt;We could have printed 40 confident ranks. Instead the portal shows &lt;strong&gt;tie groups&lt;/strong&gt;: projects the data can't separate share a group. On the fixtures there are &lt;strong&gt;2 groups&lt;/strong&gt;, not 40 ranks. A ranking that claims more precision than the data has misleads people, and the people it misleads are the ones who didn't win.&lt;/p&gt;

&lt;p&gt;The tie-grouping has its own trap. Group "projects within one SD of their neighbour" and a long run of small gaps chains everyone into a single tie. So a project joins a group only if it's within one pooled SD of the group's &lt;strong&gt;leader&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;tieGroups&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ranked&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;normalized&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;}[]):&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;group&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;leader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;normalized&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;sd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;ranked&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pooled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;leader&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;leader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sd&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sd&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;leader&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;leader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;normalized&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;normalized&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nx"&gt;pooled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;group&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nx"&gt;leader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;group&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The bug we actually wrote: flagging flat judges
&lt;/h3&gt;

&lt;p&gt;The organiser dashboard flags judges who "gave every project the same score," so jdg_07 can be spotted before results are computed. Our first version flagged judges whose &lt;strong&gt;weighted scores&lt;/strong&gt; were identical across reviews.&lt;/p&gt;

&lt;p&gt;The fixtures proved it wrong. &lt;code&gt;jdg_19&lt;/code&gt; gave &lt;strong&gt;3/5/3, 3/4/4 and 5/4/2&lt;/strong&gt;. All three average &lt;strong&gt;3.67&lt;/strong&gt;. That judge clearly told the projects apart; the averages just matched by chance. Our flag put them in the same group as jdg_07.&lt;/p&gt;

&lt;p&gt;The fix: a judge is flat only when they give &lt;strong&gt;exactly the same marks, criterion by criterion, across at least three final reviews.&lt;/strong&gt; Two reviews are too few to tell either way. On the fixtures, that flags jdg_07 and nobody else.&lt;/p&gt;

&lt;p&gt;A related rule: &lt;strong&gt;a missing or out-of-range criterion is an error, not a zero.&lt;/strong&gt; Treating a blank as 0 is the kind of default that quietly changes who wins. The engine throws a &lt;code&gt;RubricError&lt;/code&gt;, and the database rejects out-of-range values as well.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. The spec line we thought was simple: duplicates
&lt;/h2&gt;

&lt;p&gt;The spec says "forty projects." The fixture file has &lt;strong&gt;41&lt;/strong&gt;. The extra one is "Dry Harbour", submitted twice by team &lt;code&gt;tm_07&lt;/code&gt; as &lt;code&gt;prj_07&lt;/code&gt; and &lt;code&gt;prj_41&lt;/code&gt;. Both copies have reviews.&lt;/p&gt;

&lt;p&gt;We planned for it with two rules that each looked obvious:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One live submission per team.&lt;/strong&gt; It's a business rule, so enforce it in the database with a partial unique index.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show both copies of a suspected duplicate until an organiser decides.&lt;/strong&gt; Never silently drop someone's work.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The two rules contradict each other on the first import.&lt;/strong&gt; Loading the fixtures as they are violates rule 1. Enforcing rule 1 throws away data, which breaks rule 2.&lt;/p&gt;

&lt;p&gt;The fix was a third state. The older copy goes on hold, and the index ignores held rows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;UNIQUE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="nv"&gt;"submissions_one_live_per_team"&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="nv"&gt;"submissions"&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;"event_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;"team_id"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;"superseded_by_id"&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="nv"&gt;"duplicate_hold"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That only covered importing. &lt;strong&gt;Resolving&lt;/strong&gt; the duplicate turned out to be most of the work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which reviews count after a merge?&lt;/strong&gt; "The later score wins" sounds reasonable, but the fixture scores have no timestamps, so "later" can't be computed. Dropping the older copy's reviews would delete &lt;code&gt;jdg_01&lt;/code&gt;'s &lt;strong&gt;only score in the whole file&lt;/strong&gt;. The rule we settled on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If a judge reviewed &lt;strong&gt;both&lt;/strong&gt; copies, the kept (newer) copy's review counts, since they judged the final version. Their older review is kept but marked superseded.&lt;/li&gt;
&lt;li&gt;If a judge reviewed &lt;strong&gt;only the older&lt;/strong&gt; copy, the review moves to the kept entry and records where it came from.&lt;/li&gt;
&lt;li&gt;On the fixtures, &lt;code&gt;prj_41&lt;/code&gt; ends up with 6 counted reviews.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;It has to be undoable exactly.&lt;/strong&gt; Organisers make mistakes. "Reopen" reverses a decision row by row, and a test compares every assignment and review against a snapshot taken before the decision.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decisions can't chain.&lt;/strong&gt; If A merges into B and B later merges into C, undoing the first decision becomes ambiguous. So confirming is refused (&lt;code&gt;409 duplicate_chain&lt;/code&gt;) when either entry is already part of a confirmed decision. Two organisers can click two flags that share an entry at the same moment, so both rows are locked with &lt;code&gt;SELECT … FOR UPDATE&lt;/code&gt; before the check, and the flag leaves &lt;code&gt;PENDING&lt;/code&gt; through a conditional update so it can't be decided twice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"In judging" had three different definitions.&lt;/strong&gt; Assignment, the judge console, the progress dashboard and rankings each had their own idea of which entries count. Duplicates, holds and disqualifications made the copies disagree. We replaced them with one function: submitted, eligible, not held, not replaced. Everything that needs the definition calls it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rankings had to notice on their own.&lt;/strong&gt; Every ranking run stores SHA-256 hashes of its inputs and its result. A duplicate decision changes the reviews a run reads, so the inputs hash no longer matches, the run goes stale, and &lt;strong&gt;the portal refuses to publish it.&lt;/strong&gt; It also refuses to publish while any duplicate is still undecided. We didn't need a special case for this; the receipts handled it.&lt;/p&gt;

&lt;p&gt;The duplicate also gave us something useful. A team submitting the same work twice, scored by the same judges, is a &lt;strong&gt;free test–retest experiment.&lt;/strong&gt; That's where the 1.11-point self-disagreement in section 3 comes from. The hardest part of the spec ended up supporting our main argument about the scoring.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Runner-up for "simple until it wasn't": &lt;strong&gt;"edit until the deadline."&lt;/strong&gt; Does submitting lock the entry? (No: a team that finds a typo at 17:55 should be able to fix it.) Does the deadline apply to the first write or to every write? (Every write: create, edit and submit, checked against the server clock in UTC.) Can organisers edit a team's entry? (No: they can read it, but the content belongs to the team.)&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What we'd tell the next team
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Write down where authority lives before you write any code.&lt;/strong&gt; "The API is the only authority" settled more arguments than any other sentence in the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use topology to enforce constraints.&lt;/strong&gt; An &lt;code&gt;internal: true&lt;/code&gt; network caught a dependency calling home that no code review would have spotted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Any IP-keyed control behind your own proxy is probably wrong.&lt;/strong&gt; Test through the real network path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test the textbook algorithm against your actual data before you ship it.&lt;/strong&gt; Z-scores looked fine until we counted the judges they silently dropped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report uncertainty instead of hiding it.&lt;/strong&gt; "These 16 projects can't be told apart" is a more honest result than a confident rank 7.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A spec line with two "obvious" rules in it probably has a conflict between them.&lt;/strong&gt; Look for it before the import fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write a decision record for each choice, at the time you make it.&lt;/strong&gt; We have 32 of them. When something broke on the last day, we could see why it had been built that way.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The code, the 32 decision records and the generated normalization proof are all in the repo: &lt;strong&gt;&lt;a href="https://github.com/Len3hq/evenhand" rel="noopener noreferrer"&gt;github.com/Len3hq/evenhand&lt;/a&gt;&lt;/strong&gt;. It's MIT-licensed, and &lt;code&gt;docker compose up&lt;/code&gt; gets you a seeded portal at &lt;code&gt;localhost:8080&lt;/code&gt;, network or no network.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built with Claude Code. The humans on the team made the design decisions, reviewed every change, and can defend the schema and the maths in writing.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>hackathon</category>
      <category>docker</category>
      <category>typescript</category>
      <category>statistics</category>
    </item>
  </channel>
</rss>
