<?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: Gaurav</title>
    <description>The latest articles on DEV Community by Gaurav (@gaurav-sid).</description>
    <link>https://dev.to/gaurav-sid</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%2F3707898%2F2a634d5a-b57c-4ba8-8ae1-be2bb2ab6431.png</url>
      <title>DEV Community: Gaurav</title>
      <link>https://dev.to/gaurav-sid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gaurav-sid"/>
    <language>en</language>
    <item>
      <title>I built a hackathon judging app and it was too confident</title>
      <dc:creator>Gaurav</dc:creator>
      <pubDate>Fri, 02 Oct 2026 06:48:25 +0000</pubDate>
      <link>https://dev.to/gaurav-sid/i-built-a-hackathon-judging-app-and-it-was-too-confident-ege</link>
      <guid>https://dev.to/gaurav-sid/i-built-a-hackathon-judging-app-and-it-was-too-confident-ege</guid>
      <description>&lt;p&gt;DOGFOOD 2026 had a funny premise. Everyone builds the same thing: the portal that will judge the hackathon. The winner gets forked and used for real events. So you are building the thing that decides who gets the prize money, and then it gets used on you.&lt;/p&gt;

&lt;p&gt;My entry is called Raptor Desk. Django, HTMX, SQLite, one &lt;code&gt;docker compose up&lt;/code&gt;. This post isn't a feature tour. It's about the part that actually kept me busy: getting a fair ranking out of messy judge scores, then finding out my app was more sure of itself than it had any right to be.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/GauravS13/raptor-desk" rel="noopener noreferrer"&gt;https://github.com/GauravS13/raptor-desk&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  the official data is a trap
&lt;/h2&gt;

&lt;p&gt;The organizers ship a fixtures file with the brief: 40 projects, 30 judges, 126 score sheets, each scoring functionality, quality and innovation. It looks boring. It isn't.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The plain average has a &lt;strong&gt;tie for first place&lt;/strong&gt;. prj_11 and prj_34 both score 4.333.&lt;/li&gt;
&lt;li&gt;prj_10 is &lt;strong&gt;3rd&lt;/strong&gt; on the average. It had two reviews, and one came from jdg_15, the second most generous judge in the set. Correct for that and it drops to 7th. That's prize money moving because of who happened to review it.&lt;/li&gt;
&lt;li&gt;One judge (jdg_07) gives the exact same score on every criterion for every project.&lt;/li&gt;
&lt;li&gt;prj_41 is prj_07 submitted twice.&lt;/li&gt;
&lt;li&gt;Three different teams are called "StillTrail".&lt;/li&gt;
&lt;li&gt;49 reviews have no written comment at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The one that changed how I thought about the whole problem: judges differ more from each other than projects do. Judge leniency in this data runs from about −0.82 to +0.52. The gap between neighbouring projects is 0.02 to 0.10. So "who reviewed you" matters more than "how good you are" unless you correct for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  the textbook fix breaks on this data
&lt;/h2&gt;

&lt;p&gt;The first thing everyone reaches for is a per-judge z-score. Take each judge's scores, subtract their mean, divide by their standard deviation. Harsh and generous judges end up on the same scale.&lt;/p&gt;

&lt;p&gt;On the official fixtures it gives &lt;strong&gt;NaN for 7 projects&lt;/strong&gt;. Dividing by the standard deviation is the problem. The flat-lining judge has a spread of zero. So does any judge who only reviewed one project. Divide by zero, and those projects can't be ranked at all.&lt;/p&gt;

&lt;p&gt;What I used instead is an additive model. Every score is the project's quality, plus the judge's leniency, plus noise:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;score(judge, project) = quality(project) + leniency(judge) + noise
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fit it with a little ridge regularisation so a judge with one review can't get a wild leniency estimate. Then alternate: estimate qualities given leniencies, then leniencies given qualities, until it settles.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="n"&gt;over&lt;/span&gt; &lt;span class="n"&gt;judges&lt;/span&gt; &lt;span class="nf"&gt;of &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&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;judge&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;lam&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;mu&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="n"&gt;n_reviews&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;lam&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="n"&gt;over&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="nf"&gt;of &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;project&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="n"&gt;n_reviews_by_judge&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;lam&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It never divides by anyone's spread, so the flat-liner can't break it. That judge's scores carry no ranking information anyway, so the app detects it (identical scores on every criterion, every time) and leaves it out of the fit.&lt;/p&gt;

&lt;p&gt;How do you know it's better? The fixtures have no right answer, so I made data that does. 200 fake hackathons where I know each project's real quality, with harsh and generous judges, noise, missing reviews and one flat-liner. Then I compare how well each method gets the true order back.&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;how well it recovers the true order (Spearman)&lt;/th&gt;
&lt;th&gt;beats the plain average in&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;plain average&lt;/td&gt;
&lt;td&gt;0.697&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;z-score with shrinkage&lt;/td&gt;
&lt;td&gt;0.778&lt;/td&gt;
&lt;td&gt;96% of runs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;additive model&lt;/td&gt;
&lt;td&gt;0.813&lt;/td&gt;
&lt;td&gt;96% of runs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Good. Bias correction works. That part went fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  then i made it say how sure it was
&lt;/h2&gt;

&lt;p&gt;A ranking with no uncertainty is a lie with decimals. So the app resamples each project's reviews 300 times, refits, and counts how often each project lands in the top 1, 2, 3 and 5. That gives every project a "chance of a top-5 finish". Anything between 20% and 80% is flagged as a close call.&lt;/p&gt;

&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%2Fzbfmfetalrtqtex4bo1o.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%2Fzbfmfetalrtqtex4bo1o.png" alt="organizer results page with each project's chance of a top-5 finish" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the fixtures this says what you'd hope: places 1 and 2 look solid, places 3 to 5 are close calls. Then the app suggests which judge should review which close-call project to settle it, within a budget the organizer sets. Whatever is still close after that goes to a deliberation page where a person has to write down why they decided.&lt;/p&gt;

&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%2Fxrgy9di14ira0qj0n99r.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%2Fxrgy9di14ira0qj0n99r.png" alt="close calls with the judges the app suggests asking" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was pretty happy with this. Then I tested it.&lt;/p&gt;

&lt;h2&gt;
  
  
  then i checked if it was telling the truth
&lt;/h2&gt;

&lt;p&gt;If the app says "90% interval", the true value should land inside it about 90% of the time. If it says a project has a 70% chance of a top-5 finish, projects like that should make the top 5 about 70% of the time. I had the 200 fake hackathons with known answers, so I could just check. 7,973 projects in total.&lt;/p&gt;

&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%2Ftkg3gb9mge242o11c869.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%2Ftkg3gb9mge242o11c869.png" alt="what the app said vs what happened: stated chance against real top-5 rate" width="800" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was too confident.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The "90% intervals" contained the true quality &lt;strong&gt;52%&lt;/strong&gt; of the time. Not 90.&lt;/li&gt;
&lt;li&gt;For projects with one useful review it was 22%. With two, 48%. With three or more, 59%.&lt;/li&gt;
&lt;li&gt;When the app said 95% or more, the project actually finished top 5 about &lt;strong&gt;80%&lt;/strong&gt; of the time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reason is kind of obvious once you see it. The resampling only shuffles the reviews a project already has. With two or three reviews there just aren't many ways to shuffle, so the spread looks small. It can't imagine a fourth judge who disagrees. With one review there's nothing to shuffle at all, so the interval has zero width. Very confident, about nothing.&lt;/p&gt;

&lt;p&gt;It wasn't useless though. Two numbers made me keep it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As a forecast it still clearly beats guessing. &lt;a href="https://en.wikipedia.org/wiki/Brier_score" rel="noopener noreferrer"&gt;Brier score&lt;/a&gt; 0.073, against 0.109 for just saying the base rate every time (lower is better).&lt;/li&gt;
&lt;li&gt;Of all the projects the ranking put on the wrong side of the prize line, &lt;strong&gt;half had already been flagged as close calls&lt;/strong&gt;. The doubt was pointing at the right places, it just wasn't strong enough.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I didn't hide it. The numbers are in the repo's &lt;a href="https://github.com/GauravS13/raptor-desk/blob/main/JUDGING.md" rel="noopener noreferrer"&gt;JUDGING.md&lt;/a&gt;, generated by &lt;a href="https://github.com/GauravS13/raptor-desk/blob/main/tools/simulate_proof.py" rel="noopener noreferrer"&gt;a script&lt;/a&gt; that CI reruns, so they can't quietly drift. And the app's job changed a bit in my head: chances are for pointing people at the doubt, never for deciding. A model never settles a prize place on its own.&lt;/p&gt;

&lt;p&gt;The fix is known. You resample the judges' leniencies too, not just the reviews. I didn't ship it. It would have changed every chance the app shows, and I'd want to rerun the same calibration check on it first. Shipping a fix for overconfidence without measuring it would be the same mistake again.&lt;/p&gt;

&lt;h2&gt;
  
  
  one judge can pick the winner
&lt;/h2&gt;

&lt;p&gt;The calibration result made me wonder what else the resampling couldn't see. It shuffles reviews but always keeps every judge. So what happens if you take a judge out?&lt;/p&gt;

&lt;p&gt;I added a "kingmaker check" (&lt;a href="https://github.com/GauravS13/raptor-desk/blob/main/src/scoring_engine/influence.py" rel="noopener noreferrer"&gt;the code is short&lt;/a&gt;). Refit the whole ranking once per judge, leaving that judge out. If removing one judge alone changes who's in the top 5, or who's first, flag it.&lt;/p&gt;

&lt;p&gt;On the official fixtures:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;without judge&lt;/th&gt;
&lt;th&gt;their reviews&lt;/th&gt;
&lt;th&gt;what changes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;jdg_04&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;first place goes from prj_34 to prj_37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;jdg_15&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;first place goes from prj_34 to prj_11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;jdg_24&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;prj_16 and prj_18 move into the top 5, prj_33 and prj_37 drop out&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;six others&lt;/td&gt;
&lt;td&gt;5 to 9&lt;/td&gt;
&lt;td&gt;one project in or out of the top 5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;9 of 30 judges each move a top-5 place on their own. And two of them flip first place, the one place the resampling called fairly safe. jdg_04 did four reviews. Four.&lt;/p&gt;

&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%2Fbjs0l3zrsohstxr01mn2.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%2Fbjs0l3zrsohstxr01mn2.png" alt="kingmaker check: judges whose removal alone changes the top 5" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reason is the same as before. Each judge's leniency is estimated from a handful of reviews. Take a judge out and the corrections for everyone they overlapped with shift a little, and at the top the gaps are tiny.&lt;/p&gt;

&lt;p&gt;I thought about automatically down-weighting these judges and decided not to. A kingmaker isn't a bad judge. It just means a prize is resting on one person's opinion. So the app shows the list next to the close calls, and the organizer can ask for more reviews or decide on the record. There's also an API for it: &lt;code&gt;GET /api/events/{id}/kingmakers&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  three bugs i actually learned something from
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. signed by itself.&lt;/strong&gt; Results get frozen into a snapshot signed with Ed25519, and anyone can verify it. My first verifier checked the signature using the public key stored inside the document. Spot it? Anyone can change the results, sign them with their own key, put their key in the document, and it verifies perfectly. It's self-consistent, it's just not &lt;em&gt;mine&lt;/em&gt;. Fixed on Sunday night:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# before: trusts whatever key the document brings
&lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;signing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;signature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;public_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="c1"&gt;# after: the key itself has to be this deployment's
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;public_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nf"&gt;public_key_hex&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;signed with a different key, not by this deployment&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The offline verifier now takes the portal's key from outside the document too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. the audit log lost exactly the attacks.&lt;/strong&gt; Every vote attempt is audited, accepted or refused. Refusals (voting twice, voting for your own team) raised an error inside the database transaction. The error rolled back the transaction, and the audit entry with it. So the log had every honest vote and none of the cheating attempts. Simplified:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# before
&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;atomic&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;refused&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;audit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;vote.refused&lt;/span&gt;&lt;span class="sh"&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;# rolled back with everything else
&lt;/span&gt;        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="n"&gt;refused_error&lt;/span&gt;

&lt;span class="c1"&gt;# after
&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;atomic&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;refusal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;refusal&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;vote&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;audit&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="bp"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;refusal&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nf"&gt;refused&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;refusal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# audited outside the rolled-back block
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. same data, different numbers.&lt;/strong&gt; The resampling uses a fixed seed, so I assumed it was reproducible. It wasn't. The reviews came out of the database in whatever order the database felt like, and with a seeded random generator a different input order means different resamples. Same scores, different results: prj_37's chance of a top-5 finish was 0.64 with the reviews in one order and 0.58 in another. The docs computed from the fixtures file and the app read the same scores from the database in a different order, so they disagreed. Fix was one line, sort the input before doing anything. Then CI regenerates the docs from the engine and fails if they don't match.&lt;/p&gt;

&lt;h2&gt;
  
  
  the spec was harder than it looked
&lt;/h2&gt;

&lt;p&gt;The organizers' acceptance checker only tests tiers 1 and 2: public gallery, judge isolation, CSV export. Tiers 3 and 4 (public voting, webhooks, an embed, import and export) aren't checked by anything.&lt;/p&gt;

&lt;p&gt;So I wrote my own checker for those, same report format, and said in the README that it's mine. The thing I learned writing it: &lt;strong&gt;a portal that refuses everything passes every "should be refused" test.&lt;/strong&gt; If you only check that a participant gets 403, a broken app that 403s everyone looks perfect. So every "refused" check has an "allowed" twin right next to it. A vote for your own team is refused, and someone from another team voting for the same project goes through. If both don't hold, the check fails. 32 checks in total.&lt;/p&gt;

&lt;p&gt;Smaller ones that bit me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;My own security headers broke the API docs.&lt;/strong&gt; A strict Content-Security-Policy blocked the Swagger UI from a CDN, so &lt;code&gt;/api/docs&lt;/code&gt; was a blank page. Serve it locally.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One route ate another.&lt;/strong&gt; &lt;code&gt;/api/events/import&lt;/code&gt; got matched as &lt;code&gt;/api/events/{event_id}&lt;/code&gt; with an event id of "import". Moved it to &lt;code&gt;/api/event-bundles&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Imports went straight to public.&lt;/strong&gt; An exported event that was published came back in as published, so importing an archive made it public instantly. Imports now land as drafts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My CI was never green.&lt;/strong&gt; I'd pinned &lt;code&gt;astral-sh/setup-uv@v10&lt;/code&gt;. That version doesn't exist. Meanwhile the README was going on about proof. Now CI also reruns the official checker against a fresh &lt;code&gt;docker compose up&lt;/code&gt; and compares its output with the committed report byte for byte.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  what i cut, and what i'd redo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cut, and fine with it&lt;/strong&gt; (every one of these, with the reasons, is in the &lt;a href="https://github.com/GauravS13/raptor-desk/blob/main/docs/DECISION-LOG.md" rel="noopener noreferrer"&gt;decision log&lt;/a&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PostgreSQL as the default. SQLite in WAL mode with immediate transactions is plenty for a hackathon and keeps it one command.&lt;/li&gt;
&lt;li&gt;Celery and Redis. A small outbox table and a worker container do the emails and webhooks.&lt;/li&gt;
&lt;li&gt;Alpine.js. Its normal build needs &lt;code&gt;unsafe-eval&lt;/code&gt;, which my CSP refuses.&lt;/li&gt;
&lt;li&gt;Pairwise "A or B?" judging replacing the scores. It's there, but beside the scores, not instead of them. A rubric with weights and a pass/fail gate can't be expressed as pairs.&lt;/li&gt;
&lt;li&gt;Blocking votes per IP address. A room full of people on the venue Wi-Fi looks exactly like ballot stuffing. Organizers can mark trusted networks instead, and suspicious bursts get held for review, never thrown away.&lt;/li&gt;
&lt;li&gt;Sealed commit-reveal voting. Didn't have time to do it properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Would redo:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The score ledger from the first commit.&lt;/strong&gt; I added a hash-chained, signed ledger of every score after reviews already existed, so I needed a backfill migration for the old ones. It works, but "verifiable from the start" beats "verifiable after a migration".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The resampling.&lt;/strong&gt; See above. Resample judges, not just reviews, and check calibration again before shipping it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/GauravS13/raptor-desk
&lt;span class="nb"&gt;cd &lt;/span&gt;raptor-desk
docker compose up
&lt;span class="c"&gt;# http://localhost:8080 , demo accounts are on the sign-in page&lt;/span&gt;

python3 tools/run.py .dogfood.toml &lt;span class="nt"&gt;--fixtures&lt;/span&gt; data/fixtures.json   &lt;span class="c"&gt;# official checker, 7/7&lt;/span&gt;
uv run python tools/simulate_proof.py &lt;span class="nt"&gt;--check&lt;/span&gt;                     &lt;span class="c"&gt;# every number in this post&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The calibration and kingmaker numbers come from &lt;code&gt;tools/simulate_proof.py&lt;/code&gt;, and the method is in &lt;a href="https://github.com/GauravS13/raptor-desk/blob/main/JUDGING.md" rel="noopener noreferrer"&gt;JUDGING.md&lt;/a&gt;. If you think my maths is wrong somewhere, I'd honestly like to know.&lt;/p&gt;

&lt;p&gt;Built for #DogfoodHackathon by &lt;a href="https://dev.to/raptorsdev"&gt;Hackathon Raptors&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>showdev</category>
      <category>hackathonraptors</category>
    </item>
    <item>
      <title>We Built a Feature We Never Shipped — And That Was the Whole Point</title>
      <dc:creator>Gaurav</dc:creator>
      <pubDate>Fri, 04 Sep 2026 05:01:09 +0000</pubDate>
      <link>https://dev.to/gaurav-sid/we-built-a-feature-we-never-shipped-and-that-was-the-whole-point-2k76</link>
      <guid>https://dev.to/gaurav-sid/we-built-a-feature-we-never-shipped-and-that-was-the-whole-point-2k76</guid>
      <description>&lt;p&gt;Somewhere in the middle of building &lt;a href="https://github.com/GauravS13/KilnForge" rel="noopener noreferrer"&gt;KilnForge&lt;/a&gt;, we wrote a fully working feature, tested it, confirmed it was correct — and then didn't ship it. On purpose. That's not a typo. It's the most honest answer we have to what this post is actually about.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Key Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We hand-rolled a byte-level EXIF orientation parser, then discovered &lt;code&gt;Bun.Image&lt;/code&gt; already does that internally — shipping ours would have double-rotated every tagged photo&lt;/li&gt;
&lt;li&gt;Three other "obvious" &lt;code&gt;sharp&lt;/code&gt; features don't exist natively in &lt;code&gt;Bun.Image&lt;/code&gt;: a BMP/GIF encoder, a &lt;code&gt;fit: cover&lt;/code&gt; resize mode, and arbitrary-angle rotation — each needed a real, hand-rolled fallback&lt;/li&gt;
&lt;li&gt;We also found a bug in our own reproducible-build proof: 3 compiles produced 3 different hashes, traced to 2 differing bytes out of ~89MB — our own filename, not the build&lt;/li&gt;
&lt;li&gt;Measured, not estimated: KilnForge runs 1.81x–10.22x faster than &lt;code&gt;sharp&lt;/code&gt; on resize/rotate/convert, and 41.73x faster than &lt;code&gt;tar&lt;/code&gt; at unpacking archives — but 1.22x &lt;em&gt;slower&lt;/em&gt; at packing them, published honestly either way&lt;/li&gt;
&lt;li&gt;263 tests, 6,463 assertions, all passing — including differential tests run against real &lt;code&gt;sharp&lt;/code&gt; and real &lt;code&gt;tar&lt;/code&gt; output, not synthetic stand-ins&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How We Verified All of This
&lt;/h2&gt;

&lt;p&gt;Every claim in this post comes from one of three concrete checks, not from reading a changelog:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Direct API probing&lt;/strong&gt; — calling the actual method on the actual installed &lt;a href="https://bun.sh" rel="noopener noreferrer"&gt;Bun&lt;/a&gt; binary (1.4.0) and recording what happens, success or exception, before writing a single line of pipeline code around it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pixel-level differential comparison&lt;/strong&gt; — comparing our output against &lt;code&gt;Bun.Image&lt;/code&gt;'s own native output, byte for byte, on identical source images (used to catch the rotation off-by-half-pixel bug and to confirm the EXIF auto-rotation behavior).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real reference-implementation testing&lt;/strong&gt; — running our output through the same test suite against real &lt;code&gt;sharp&lt;/code&gt; and real &lt;code&gt;tar&lt;/code&gt; output on identical inputs, not synthetic stand-ins, via golden-corpus tests that ship in the repo.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of it is reproducible: &lt;code&gt;bun test&lt;/code&gt; runs all 263 tests, including the golden-corpus suite, from a clean checkout.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Package We'd Normally Install
&lt;/h2&gt;

&lt;p&gt;If you're processing images on a server, you reach for &lt;a href="https://www.npmjs.com/package/sharp" rel="noopener noreferrer"&gt;&lt;code&gt;sharp&lt;/code&gt;&lt;/a&gt;. It's fast, it's mature, and underneath it's a native addon wrapping libvips — which means a real C build toolchain has to exist on whatever machine installs it. If you're bundling files, you reach for &lt;a href="https://www.npmjs.com/package/tar" rel="noopener noreferrer"&gt;&lt;code&gt;tar&lt;/code&gt;&lt;/a&gt;. Both are exactly the kind of dependency a zero-dependency hackathon exists to prove you don't strictly need.&lt;/p&gt;

&lt;p&gt;So we set out to replace both, using Bun's own native &lt;a href="https://bun.sh/docs" rel="noopener noreferrer"&gt;&lt;code&gt;Bun.Image&lt;/code&gt; and &lt;code&gt;Bun.Archive&lt;/code&gt;&lt;/a&gt; APIs — no &lt;code&gt;sharp&lt;/code&gt;, no &lt;code&gt;tar&lt;/code&gt;, no native build step. &lt;code&gt;dependencies: {}&lt;/code&gt; in &lt;code&gt;package.json&lt;/code&gt;, checked mechanically on every build via a script that scans every import in &lt;code&gt;src/**&lt;/code&gt; and refuses to let either package sneak in. This is our entry for a &lt;a href="https://zerodepshack.com" rel="noopener noreferrer"&gt;zero-dependency hackathon&lt;/a&gt; that scores exactly that kind of mechanical proof over a README claim.&lt;/p&gt;

&lt;p&gt;That part sounds simple in a pitch. It wasn't simple in practice, because &lt;code&gt;Bun.Image&lt;/code&gt; and &lt;code&gt;Bun.Archive&lt;/code&gt; are both very new APIs — days old at the point we started. The write-ups we found while planning disagreed with each other on basic questions, color-profile survival being the clearest example: some sources claimed ICC profiles survive a transcode, others claimed they get stripped. We didn't pick a side. We built a minimal PNG carrying a real color-profile chunk, ran it through &lt;code&gt;Bun.Image&lt;/code&gt;'s own encoder, and checked the output bytes directly. The chunk was gone. One test resolved a contradiction that no amount of re-reading either source would have.&lt;/p&gt;

&lt;p&gt;We decided early that we wouldn't build anything on top of an assumption we hadn't personally verified against the real, installed Bun binary. That decision is the reason this post has a story to tell instead of just a features list.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Built By Hand
&lt;/h2&gt;

&lt;p&gt;Before writing any pipeline code, we wrote a &lt;strong&gt;Foundation Verification Harness&lt;/strong&gt; — a script that runs real probes against the actual Bun runtime and records what it finds, separate from whether the probe itself crashed:&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;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;probe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ProbeResult&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="nx"&gt;name&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="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;finding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;detail&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="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;finding&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;detail&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;results&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;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;finding&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;detail&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;finding&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;results&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;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;finding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`threw unexpectedly: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;err&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="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&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;&lt;code&gt;ok&lt;/code&gt; answers "did this probe run without crashing." &lt;code&gt;finding&lt;/code&gt; answers "what did it actually discover." Those are different questions — a probe can run perfectly cleanly and still report a negative finding, and that's a successful, informative run, not a failure. Every architectural decision downstream got pinned to what this harness actually measured, not to what we assumed going in.&lt;/p&gt;

&lt;p&gt;It's a good thing we did, because several of those assumptions were wrong.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Bun.Image&lt;/code&gt; has no BMP or GIF encoder
&lt;/h3&gt;

&lt;p&gt;Our original plan was to choose between a PNG channel and a BMP channel for reading and writing raw pixels. Real inspection of &lt;code&gt;Bun.Image.prototype&lt;/code&gt; showed no &lt;code&gt;.bmp()&lt;/code&gt; and no &lt;code&gt;.gif()&lt;/code&gt; method at all — both formats are decode-only. PNG wasn't the &lt;em&gt;preferred&lt;/em&gt; channel. It was the &lt;em&gt;only&lt;/em&gt; one. That meant hand-rolling a real PNG encoder/decoder from scratch: chunk parsing, &lt;code&gt;node:zlib&lt;/code&gt; for the inflate/deflate, scanline filter/unfilter, our own CRC32 — just to get a working raw-pixel round trip.&lt;/p&gt;

&lt;h3&gt;
  
  
  There's no native &lt;code&gt;fit: cover&lt;/code&gt; resize mode
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Bun.Image.resize()&lt;/code&gt; only exposes &lt;code&gt;fill&lt;/code&gt; (stretch to exact dimensions) and &lt;code&gt;inside&lt;/code&gt; (aspect-preserving, fits within the box). There's no crop-to-fill. We built it ourselves — compute the overscale factor that would cover the target box while preserving aspect ratio, resize with the native &lt;code&gt;fill&lt;/code&gt; mode, then center-crop the raw pixel buffer down to size:&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;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;resizeCover&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Bun&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;targetWidth&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="nx"&gt;targetHeight&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="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Bun&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Image&lt;/span&gt;&lt;span class="o"&gt;&amp;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;meta&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;metadata&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;scale&lt;/span&gt; &lt;span class="o"&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;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;targetWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;targetHeight&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&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;overW&lt;/span&gt; &lt;span class="o"&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;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;scale&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;overH&lt;/span&gt; &lt;span class="o"&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;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;scale&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;resized&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;overW&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;overH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fill&lt;/span&gt;&lt;span class="dl"&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;rgba&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;toRGBA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resized&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;cropped&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;cropCenter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;targetWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;targetHeight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;loadImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fromRGBA&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cropped&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;
  
  
  Arbitrary-angle rotation isn't native either
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Bun.Image.rotate(45)&lt;/code&gt; genuinely throws — "only multiples of 90 are supported" — confirmed directly, not assumed from a changelog. We wrote our own rotation via an inverse coordinate transform, and it had a bug worth mentioning: the first version was wrong by exactly half a pixel, because it treated a pixel's raw integer index as its coordinate instead of the &lt;em&gt;center&lt;/em&gt; of the cell that pixel occupies:&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="c1"&gt;// Pixel index i occupies the continuous interval [i, i+1) with its&lt;/span&gt;
&lt;span class="c1"&gt;// CENTER at i+0.5 — sampling must rotate from that center, not from&lt;/span&gt;
&lt;span class="c1"&gt;// the raw integer index, or the whole mapping is off by half a pixel&lt;/span&gt;
&lt;span class="c1"&gt;// (verified by hand against Bun.Image's native rotate(90), which has&lt;/span&gt;
&lt;span class="c1"&gt;// an exact, unambiguous discrete answer to check against).&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;relY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dy&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;destCenterY&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;relX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dx&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;destCenterX&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;srcX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;relX&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;cos&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;relY&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;sin&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;srcCenterX&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;srcY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;relX&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;sin&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;relY&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;cos&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;srcCenterY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one-line fix (&lt;code&gt;+ 0.5&lt;/code&gt;) took a 58% pixel mismatch against &lt;code&gt;Bun.Image&lt;/code&gt;'s own native &lt;code&gt;rotate(90)&lt;/code&gt; — used as a cross-check oracle for the 90° case, which &lt;em&gt;is&lt;/em&gt; native — down to zero mismatches across every test we threw at it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Feature We Never Shipped
&lt;/h2&gt;

&lt;p&gt;Here's the part we're actually proudest of, and it's not a feature that shipped — it's one that didn't.&lt;/p&gt;

&lt;p&gt;We built a complete, tested, byte-level EXIF orientation parser by hand: reads the JPEG APP1 marker, walks the TIFF structure, handles both byte orders (Intel and Motorola), covers all eight orientation values, and converts the result into the correct rotate-and-flip transform. It worked. It passed its own test suite standalone. Every image-processing library we've ever used needs this, so naturally we assumed &lt;code&gt;Bun.Image&lt;/code&gt; would need it wired in too.&lt;/p&gt;

&lt;p&gt;Before wiring it into the live request pipeline, we ran one more check — because by this point "test it before you trust it" was the whole method, not just something we did once at the start. We fed a real EXIF-tagged photo straight into &lt;code&gt;Bun.Image&lt;/code&gt; with no correction of our own, and checked what came out.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Bun.Image&lt;/code&gt; had already rotated it. Correctly. On its own, during decode.&lt;/p&gt;

&lt;p&gt;We confirmed it two ways: &lt;code&gt;metadata()&lt;/code&gt; reported swapped width and height immediately after decode, and a direct pixel comparison against a manual native &lt;code&gt;.rotate(90)&lt;/code&gt; on the same source came back with zero mismatches. &lt;code&gt;Bun.Image&lt;/code&gt; auto-applies EXIF orientation internally — nobody advertised that clearly anywhere we'd read, but the runtime doesn't lie the way documentation sometimes does.&lt;/p&gt;

&lt;p&gt;If we'd shipped the original plan — wiring our own parser into the request pipeline on top of that — every single EXIF-tagged photo uploaded to the service would have been rotated &lt;strong&gt;twice&lt;/strong&gt;. Once by &lt;code&gt;Bun.Image&lt;/code&gt;, invisibly, during decode. Once by us, right after. The bug wouldn't have been subtle. It would have been &lt;em&gt;every photo, every time&lt;/em&gt;. And it would have passed casual testing anyway — anyone checking with an un-rotated test image would have seen nothing wrong.&lt;/p&gt;

&lt;p&gt;The parser still exists in the codebase today, fully tested, completely real — just deliberately disconnected from the request pipeline, with a comment explaining exactly why:&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="c1"&gt;// NOTE: this module deliberately does NOT auto-apply EXIF orientation&lt;/span&gt;
&lt;span class="c1"&gt;// before handing bytes to Bun.Image. Empirical testing (see&lt;/span&gt;
&lt;span class="c1"&gt;// src/image/exif.ts's module comment) found Bun.Image already applies&lt;/span&gt;
&lt;span class="c1"&gt;// EXIF orientation correction internally during decode — confirmed via&lt;/span&gt;
&lt;span class="c1"&gt;// metadata() reporting swapped dimensions immediately and 0 pixel&lt;/span&gt;
&lt;span class="c1"&gt;// mismatches against a manual native .rotate(90) on the same source.&lt;/span&gt;
&lt;span class="c1"&gt;// Calling our own applyOrientation() on top of that would double-rotate&lt;/span&gt;
&lt;span class="c1"&gt;// every EXIF-tagged upload.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the whole point of this post, if it has one: the win here wasn't building the parser. It was catching, before a single real user ever touched it, that building it into the pipeline would have been the bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bug in Our Own Proof
&lt;/h2&gt;

&lt;p&gt;We found one more bug the same way, and it wasn't in the product — it was in our own evidence.&lt;/p&gt;

&lt;p&gt;One of the bonuses this hackathon offers is a &lt;em&gt;reproducible build&lt;/em&gt;: compile the same source three separate times, hash each binary, prove they're identical. We ran it. We got three different SHA-256 hashes. By the letter of the check, that's a fail.&lt;/p&gt;

&lt;p&gt;Instead of writing that down as an honest limitation and moving on, we diffed the three binaries byte for byte. Out of roughly 89 megabytes, exactly two bytes were different. One of them was plain, readable text — our own &lt;code&gt;--outfile&lt;/code&gt; filename, which Bun's compiler embeds into the binary as an internal module path. We'd given each of the three test builds a different output filename, so the &lt;em&gt;test&lt;/em&gt; introduced the only variance it then measured.&lt;/p&gt;

&lt;p&gt;Fixed it by using an identical filename across three separate temp directories instead, and reran. Byte-for-byte identical. Verified with &lt;code&gt;cmp&lt;/code&gt;, zero differences. The build had been reproducible the entire time — our test of it hadn't been.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Numbers
&lt;/h2&gt;

&lt;p&gt;Bun's own release coverage cites roughly 1.2x–1.4x faster resize/convert performance for &lt;code&gt;Bun.Image&lt;/code&gt; versus &lt;code&gt;sharp&lt;/code&gt;. Our numbers below are our own independent run, on our own fixtures — not a substitute for that public figure, cited alongside it rather than instead of it.&lt;/p&gt;

&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%2F6xhl4nbezxkyqoz5pks7.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%2F6xhl4nbezxkyqoz5pks7.png" alt=" " width="800" height="539"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;KilnForge (mean)&lt;/th&gt;
&lt;th&gt;sharp (mean)&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;resize 64×48 → 20×20 (fill)&lt;/td&gt;
&lt;td&gt;0.23ms&lt;/td&gt;
&lt;td&gt;2.35ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;10.22x faster&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rotate 90° (20×40)&lt;/td&gt;
&lt;td&gt;0.11ms&lt;/td&gt;
&lt;td&gt;0.99ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;9.00x faster&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;convert JPEG → WebP (q85)&lt;/td&gt;
&lt;td&gt;0.30ms&lt;/td&gt;
&lt;td&gt;1.15ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3.83x faster&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;resize 256×256 → 30×30 (cover)&lt;/td&gt;
&lt;td&gt;1.87ms&lt;/td&gt;
&lt;td&gt;3.39ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.81x faster&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation (archive)&lt;/th&gt;
&lt;th&gt;KilnForge (mean)&lt;/th&gt;
&lt;th&gt;tar (mean)&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;unpack&lt;/td&gt;
&lt;td&gt;0.22ms&lt;/td&gt;
&lt;td&gt;9.18ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;41.73x faster&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pack (5 files × 5KB)&lt;/td&gt;
&lt;td&gt;0.11ms&lt;/td&gt;
&lt;td&gt;0.09ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.22x slower&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We didn't publish only the numbers that flatter us. On the archive side, unpacking a tarball through &lt;code&gt;Bun.Archive&lt;/code&gt; runs 41.73x faster than &lt;code&gt;tar&lt;/code&gt; — mostly because &lt;code&gt;tar&lt;/code&gt;'s own API extracts to real disk I/O per file while ours stays in memory, a genuine architectural difference. But &lt;em&gt;packing&lt;/em&gt; a tarball is 1.22x &lt;strong&gt;slower&lt;/strong&gt; with our implementation than with &lt;code&gt;tar&lt;/code&gt;. That's a small, real margin on a handful of small files, and we're stating it instead of quietly leaving it out of the chart.&lt;/p&gt;

&lt;p&gt;None of these numbers are estimates. They come from real differential tests — our output compared directly against real &lt;code&gt;sharp&lt;/code&gt; and real &lt;code&gt;tar&lt;/code&gt; output on the same inputs, both kept as &lt;code&gt;devDependencies&lt;/code&gt; used only by the benchmark and test scripts, never imported by anything that ships. A script that scans every import in the actual service code confirms that split mechanically, not by us promising it. All 263 tests pass, 6,463 assertions total, across 34 files.&lt;/p&gt;

&lt;p&gt;None of this is worth much without seeing it actually run. Here's the real thing — server up from a clean checkout, resize/watermark/convert/&lt;code&gt;/batch&lt;/code&gt; all live, the Foundation Verification Harness's own output on camera:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/rdMpBf4QRwg" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  What Going Zero-Dependency Actually Costs
&lt;/h2&gt;

&lt;p&gt;The honest answer to "what did it take to replace &lt;code&gt;sharp&lt;/code&gt; and &lt;code&gt;tar&lt;/code&gt;" isn't "we're faster" — though on most operations, measured fairly, we are. The honest answer is that a mature library like &lt;code&gt;sharp&lt;/code&gt; has quietly handled a decade of edge cases you never think about until you're the one who has to handle them: EXIF orientation, crop-to-fill resizing, arbitrary rotation angles, alpha-safe format conversion, decompression-bomb protection. None of that goes away when you drop the dependency. It just moves onto your desk.&lt;/p&gt;

&lt;p&gt;The only way we found to know we'd actually covered those edge cases — instead of just assuming our replacement code was equivalent — was to keep testing against the real runtime and the real reference implementation, the whole way through. That's what caught the EXIF bug before it shipped. That's what caught the reproducibility bug in our own proof. Neither of those would show up in a features list. Both of them are the actual work.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;We're The Vighnahartas&lt;/strong&gt; — a team entry for Track F of the &lt;a href="https://zerodepshack.com" rel="noopener noreferrer"&gt;Zero Dependency Hackathon&lt;/a&gt; (Aug 28–31, 2026). KilnForge is the project this post is about. Everything referenced here — the code, the tests, the benchmark scripts — is in the &lt;a href="https://github.com/GauravS13/KilnForge" rel="noopener noreferrer"&gt;public repo&lt;/a&gt;, built on Bun 1.4.0.&lt;/p&gt;

</description>
      <category>hackathonraptors</category>
      <category>bunjs</category>
      <category>zerodependencies</category>
      <category>showdev</category>
    </item>
    <item>
      <title>I Ported an 830-Star Python Library to Rust and the Fuzzer Found 12 Bugs — All of Them Mine 🦀</title>
      <dc:creator>Gaurav</dc:creator>
      <pubDate>Sat, 08 Aug 2026 04:45:54 +0000</pubDate>
      <link>https://dev.to/gaurav-sid/i-ported-an-830-star-python-library-to-rust-and-the-fuzzer-found-12-bugs-all-of-them-mine-3ofe</link>
      <guid>https://dev.to/gaurav-sid/i-ported-an-830-star-python-library-to-rust-and-the-fuzzer-found-12-bugs-all-of-them-mine-3ofe</guid>
      <description>&lt;p&gt;&lt;em&gt;9,549 differential fuzz cases against the real Python original. Zero divergences. Twelve bugs found — every single one was something I wrote, not something Python did.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fok3imrsaprx9hiuloste.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fok3imrsaprx9hiuloste.gif" alt="tinytag-rs terminal demo" width="799" height="561"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/tinytag/tinytag" rel="noopener noreferrer"&gt;tinytag&lt;/a&gt; is an 830-star, zero-dependency Python library that reads tags and audio properties out of WAV, AIFF, FLAC, MP3, Ogg, MP4, and WMA files. I picked it on purpose, not at random: six binary formats in one small, well-tested codebase means six different byte-layout quirks, six different chances to get "close enough" instead of exactly right — a good stress test for what "behavioral equivalence" actually costs, not just what it means in theory. For &lt;a href="https://coderesurrection.com/2026/" rel="noopener noreferrer"&gt;Port Mortem / Code Resurrection 2026&lt;/a&gt; (Track D, Python → Rust), I rewrote six of those seven formats from scratch — no &lt;code&gt;libpython&lt;/code&gt;, no PyO3, no shortcuts — and checked every claim below against the real source files in this repo, not memory.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Key Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;9,549 differential fuzz cases against the real Python original, 0 divergences, in the last qualifying 65-second run (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/fuzz/log.txt" rel="noopener noreferrer"&gt;fuzz/log.txt&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;3 real bugs in upstream tinytag, found by fuzzing, reproduced faithfully — not fixed, because matching Python's actual output is the scoring target here&lt;/li&gt;
&lt;li&gt;12 bugs the fuzzer found in this port during development, all fixed before this was written&lt;/li&gt;
&lt;li&gt;0 &lt;code&gt;unsafe&lt;/code&gt; blocks, 0 dependencies, 1.65x average speedup, honestly measured&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  👀 What This Thing Actually Does, in 10 Seconds
&lt;/h2&gt;

&lt;p&gt;Before any of the bug stories, here's the whole point of the project in one command. Point the CLI at a real MP3, and it reads the tags straight out of the file — no metadata database, no network call, just parsing bytes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;./target/release/tinytag tests/samples/cbr.mp3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"filename"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cbr.mp3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"filesize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8186&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mime_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"audio/mpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"is_lossless"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"duration"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.47020408163265304&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"channels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"bitrate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;127.99548611111112&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"samplerate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;44100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"artist"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Basshunter"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"album"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"I Can Walk On Water I Can Fly"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"I Can Walk On Water I Can Fly"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"track"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"genre"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Dance"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"year"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"2007"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"comment"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Ripped by THSLIVE"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Real output, from a real fixture file in this repo. That's the entire contract: same file in, same JSON out, whether you run the Python original or this Rust port. Everything below is the story of how hard that "same" turned out to be to actually prove — and where it wasn't quite the case yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 9,549 Cases, Zero Divergences — Here's How I Checked
&lt;/h2&gt;

&lt;p&gt;The scoring target isn't "does it work" — it's "does it produce byte-for-byte identical output to the Python original, on the same inputs, including the malformed ones." That bar is what surfaced almost everything interesting in this project.&lt;/p&gt;

&lt;p&gt;To check it, I built a differential fuzz harness (&lt;code&gt;src/bin/fuzz_harness.rs&lt;/code&gt;) that mutates real audio fixtures and runs both the vendored Python original and the Rust port against the exact same bytes, then diffs the structured output field by field. It doesn't link Python into the Rust binary — the rules explicitly disallow that — it spawns a real CPython subprocess and compares against it, which is the honest shape of differential testing.&lt;/p&gt;

&lt;p&gt;Last qualifying run, quoted directly from &lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/fuzz/log.txt" rel="noopener noreferrer"&gt;fuzz/log.txt&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;differential fuzz run started (rust-orchestrated), seed=1785680270143253800
seed corpus: 206 fixtures (full in-scope set, see fuzz_harness.rs)


9549 cases run over 65.0s
0 divergences found
ZERO DIVERGENCES
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;177 unit tests, each traced 1:1 to an expected value in upstream's own &lt;code&gt;test_all.py&lt;/code&gt; — not hand-guessed — plus that fuzz run, are the actual evidence of correctness here, not "I read the code carefully."&lt;/p&gt;

&lt;h2&gt;
  
  
  🐛 The Fuzzer Found 12 Bugs. All of Them Were Mine.
&lt;/h2&gt;

&lt;p&gt;The single biggest source of divergence across this whole project was my own instinct to write &lt;em&gt;more defensive&lt;/em&gt; Rust than the Python original actually is. Twelve times, the fuzzer caught it. A representative few, documented in full in &lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bug one: AIFF's sample rate flipped across a rounding boundary, because of a function name one letter off from the right one.&lt;/strong&gt; Here's the actual line that shipped first:&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;let&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mantissa&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;f64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;2f64&lt;/span&gt;&lt;span class="nf"&gt;.powi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exp&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;i32&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;0x3FFF&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;63&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;powi&lt;/code&gt; and &lt;code&gt;powf&lt;/code&gt; both raise a number to a power — the difference is &lt;code&gt;powi&lt;/code&gt; takes an integer exponent and uses a fast approximation, while &lt;code&gt;powf&lt;/code&gt; takes a float exponent and routes through the platform's real &lt;code&gt;pow()&lt;/code&gt;. Rust is explicit that &lt;code&gt;powi&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; guaranteed to be correctly rounded. Python's &lt;code&gt;2 ** negative_int&lt;/code&gt; always goes the &lt;code&gt;pow()&lt;/code&gt; route — the &lt;code&gt;powf&lt;/code&gt; route. Nine times out of ten that difference is invisible. But right at the edge of &lt;code&gt;u32::MAX&lt;/code&gt;, that tiny rounding error was enough to flip a truncated integer by exactly one — and "one over the line" made Rust reject a sample rate Python happily accepted. The fix ended up needing exact integer arithmetic instead of floats at all, once fuzzing pushed on it hard enough (full diff in the commit history; the one-letter version above is the part that actually mattered). Found by fuzzing mutated exponent bytes in &lt;code&gt;no_audio.aiff&lt;/code&gt; (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md #14e&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bug two, and the one that never seemed to fully die: MP4's atom-tree traversal.&lt;/strong&gt; More on that below — it's worth its own section, because "found it, fixed it" undersells what actually happened.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bug three: a too-short WAV &lt;code&gt;fact&lt;/code&gt; chunk returned an empty value instead of raising an error, like Python does.&lt;/strong&gt; My first instinct was to add a safety check — "if the chunk is at least 4 bytes, read it; otherwise skip." That felt like good defensive programming. It was also wrong. Python's own &lt;code&gt;unpack_from('I', chunk)&lt;/code&gt; has no such check: a chunk shorter than 4 bytes just raises &lt;code&gt;struct.error&lt;/code&gt;, which upstream converts into a real parse error. The fixed version reads exactly like that — no polite skip, just propagate the error:&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;// Matches upstream's unguarded `unpack_from('I', chunk)` — a too-short&lt;/span&gt;
&lt;span class="c1"&gt;// buffer is a real parse error there (struct.error -&amp;gt; ParseError), not&lt;/span&gt;
&lt;span class="c1"&gt;// something to skip gracefully.&lt;/span&gt;
&lt;span class="n"&gt;num_samples&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;u32_le&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;chunk&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="o"&gt;?&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;?&lt;/code&gt; at the end is doing the actual work: it means "if this read fails, stop and hand the error up" — no fallback, no default value, exactly what Python does when &lt;code&gt;struct.unpack_from&lt;/code&gt; blows up (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md #14a&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The pattern underneath all twelve: Rust's standard tools (&lt;code&gt;read_exact&lt;/code&gt;, bounds-checked slicing, length guards) nudge you toward code that's &lt;em&gt;more correct&lt;/em&gt; than the reference by default. For a behavioral-equivalence port, that's a bug class of its own — every one of these had to be found by actually running the same corrupted bytes through both implementations, not by code review.&lt;/p&gt;

&lt;h2&gt;
  
  
  🕳️ The Edge Case That Took the Longest to Actually Nail
&lt;/h2&gt;

&lt;p&gt;Every other bug in this post, I fixed once and it stayed fixed. MP4's atom-tree traversal took multiple separate rounds, across seven different fuzzed files, before it actually held — and each time I thought it was done, a new mutated &lt;code&gt;.m4a&lt;/code&gt; would find another angle on the same underlying mistake.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcwo710otfwm6twpfk3zh.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcwo710otfwm6twpfk3zh.gif" alt="Terminal recording of tinytag-rs parsing a corrupted MP4/M4A file and correctly recovering tags after a mid-atom corruption" width="800" height="699"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The root problem: MP4 files are nested trees of "atoms" (&lt;code&gt;moov&lt;/code&gt; → &lt;code&gt;udta&lt;/code&gt; → &lt;code&gt;meta&lt;/code&gt; → &lt;code&gt;ilst&lt;/code&gt;, and so on), and Python's traversal tracks two numbers per level — the file handle's &lt;em&gt;real&lt;/em&gt; read position, and a &lt;em&gt;logical&lt;/em&gt; position it's supposed to be at. On well-formed files those two numbers never disagree, so the distinction is invisible. On a corrupted file, they can legitimately drift apart: a header read that fails immediately still &lt;em&gt;consumes&lt;/em&gt; bytes from the stream, even though the code that failed never got to use them. Python just keeps reading from wherever the handle actually sits after that — it never tries to force the two numbers back in sync.&lt;/p&gt;

&lt;p&gt;My first version &lt;em&gt;did&lt;/em&gt; try to force them back in sync. It looked like the responsible thing to do — reset to each atom's declared end after every step, like a checkpoint. It was exactly backwards: forcing a resync meant every parent atom kept re-reading the same corrupted bytes instead of drifting past them the way Python does, so a corruption Python shrugs off and recovers from (going on to find real tags further in the file) made my port just... stop, silently returning less than it should have.&lt;/p&gt;

&lt;p&gt;The fix that actually held is one line of discipline, applied consistently everywhere a position gets threaded through:&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="n"&gt;curr_pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;on_atom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;curr_pos&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always take the &lt;em&gt;actual&lt;/em&gt; resulting position back from whatever just ran — never assume it matches what you expected going in. &lt;code&gt;skip_to&lt;/code&gt;, the function that skips a genuinely unrecognized atom, follows the same rule: a relative seek from wherever the reader currently is, never an absolute jump to a precomputed value:&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="n"&gt;skip_to&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Seek&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;R&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;atom_size&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;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&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;ParseError&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="nf"&gt;.seek&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;SeekFrom&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;Current&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;atom_size&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;i64&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="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&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;Simple once it's written down. What made it take multiple rounds is that the bug doesn't announce itself as one bug — it shows up as a &lt;em&gt;different&lt;/em&gt; symptom depending on which atom happens to be corrupted and which sibling atom comes after it: sometimes a missing tag, sometimes a whole &lt;code&gt;covr&lt;/code&gt; (cover art) atom's image data getting mis-skipped because a &lt;em&gt;child&lt;/em&gt; atom inside it was independently corrupted (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md #14g&lt;/a&gt;). Each new fuzzed file (&lt;code&gt;multi_value.m4a&lt;/code&gt;, &lt;code&gt;classical.m4a&lt;/code&gt;, &lt;code&gt;mixed_case_atoms.m4a&lt;/code&gt;, &lt;code&gt;xmp_empty.m4a&lt;/code&gt;, &lt;code&gt;test2.m4a&lt;/code&gt;, &lt;code&gt;mvhd_version_1.m4a&lt;/code&gt;, and finally &lt;code&gt;mpeg4_with_image.m4a&lt;/code&gt;) looked like a new bug the first time it failed. It wasn't — it was the same root cause, wearing a different fixture each time, until the "always return the real position" rule got applied everywhere instead of just where the first failure pointed (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md #14f, #14g&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  🔬 The Bug I Found in an 830-Star Library (and Didn't Fix)
&lt;/h2&gt;

&lt;p&gt;Three real bugs in upstream tinytag, all found by fuzzing, all left exactly as-is in the Rust port. That's deliberate: fixing any of them would make the port diverge from Python's real output on that input, which is the opposite of what's being measured.&lt;/p&gt;

&lt;p&gt;The one worth reading in full: &lt;strong&gt;MP4's &lt;code&gt;gnre&lt;/code&gt; atom has a genuine off-by-one bug, and it's the kind every programmer has written at 2am.&lt;/strong&gt; Upstream reads a 2-byte genre index, subtracts 1 (MP4 genre codes are 1-indexed), and looks it up in a genre table. It checks that the index isn't &lt;em&gt;too big&lt;/em&gt; — but never checks that it isn't negative:&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;let&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;u16_be&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&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="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;crate&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;id3v1&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;GENRES&lt;/span&gt;&lt;span class="nf"&gt;.len&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;i64&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;i64&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;real_idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&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;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;usize&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="n"&gt;idx&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;usize&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="k"&gt;if&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;genre&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;crate&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;id3v1&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;GENRES&lt;/span&gt;&lt;span class="nf"&gt;.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;real_idx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="nf"&gt;.set_str_field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"genre"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;genre&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.to_string&lt;/span&gt;&lt;span class="p"&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;Walk through it with a stored value of &lt;code&gt;0&lt;/code&gt;, meaning "no genre set": &lt;code&gt;idx = 0 - 1 = -1&lt;/code&gt;. The bounds check &lt;code&gt;idx &amp;lt; len&lt;/code&gt; passes fine (&lt;code&gt;-1&lt;/code&gt; is less than the table length). Then &lt;code&gt;real_idx = len + idx&lt;/code&gt; — Python's negative-indexing behavior, deliberately reproduced here — lands on the &lt;em&gt;last&lt;/em&gt; entry in the genre table, "Anime" in this pinned version. So a file that explicitly says "no genre" ends up tagged as Anime. Nothing in the original code marks &lt;code&gt;0&lt;/code&gt; as meaning "give me the last genre" — it reads exactly like a missing &lt;code&gt;if idx &amp;lt; 0: return&lt;/code&gt; that nobody caught, on either side, for years. This port keeps it exactly as-is, on purpose (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md #18a&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The other two, same treatment: an ID3v2 extended-header seek hardcoded to skip &lt;code&gt;- 6&lt;/code&gt; bytes regardless of how many were actually available (wrong offset on truncation, &lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;#17&lt;/a&gt;), and track/disc &lt;code&gt;"X/Y"&lt;/code&gt; splitting that silently discards a third slash-segment via Python's &lt;code&gt;split('/')[:2]&lt;/code&gt; (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;#18&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚡ 1.65x Faster, and I'm Not Going to Oversell It
&lt;/h2&gt;

&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%2Fx77rb3qq4kjo3obb71nd.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%2Fx77rb3qq4kjo3obb71nd.png" alt="Horizontal bar chart of Rust vs Python parse speed per file, ranging from 1.37x to 2.00x, overall average 1.65x" width="799" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Per-file speedup, Rust vs Python, 200 iterations per file. Overall average: 1.65x. Source: &lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/bench/results.json" rel="noopener noreferrer"&gt;bench/results.json&lt;/a&gt;, methodology in &lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/bench/methodology.md" rel="noopener noreferrer"&gt;bench/methodology.md&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Python ns/call&lt;/th&gt;
&lt;th&gt;Rust ns/call&lt;/th&gt;
&lt;th&gt;Speedup&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;vbr_xing_header.mp3&lt;/td&gt;
&lt;td&gt;75,714&lt;/td&gt;
&lt;td&gt;37,786&lt;/td&gt;
&lt;td&gt;2.00x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;flac453sStereo.flac&lt;/td&gt;
&lt;td&gt;78,752&lt;/td&gt;
&lt;td&gt;40,715&lt;/td&gt;
&lt;td&gt;1.93x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vbri.mp3&lt;/td&gt;
&lt;td&gt;133,237&lt;/td&gt;
&lt;td&gt;72,671&lt;/td&gt;
&lt;td&gt;1.83x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M1F1-mulawC-AFsp.afc&lt;/td&gt;
&lt;td&gt;71,670&lt;/td&gt;
&lt;td&gt;40,502&lt;/td&gt;
&lt;td&gt;1.77x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;test.wav&lt;/td&gt;
&lt;td&gt;59,566&lt;/td&gt;
&lt;td&gt;34,668&lt;/td&gt;
&lt;td&gt;1.72x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;test3sMono.wav&lt;/td&gt;
&lt;td&gt;62,809&lt;/td&gt;
&lt;td&gt;36,550&lt;/td&gt;
&lt;td&gt;1.72x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;flac1sMono.flac&lt;/td&gt;
&lt;td&gt;84,086&lt;/td&gt;
&lt;td&gt;60,926&lt;/td&gt;
&lt;td&gt;1.38x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UTF16.mp3&lt;/td&gt;
&lt;td&gt;151,569&lt;/td&gt;
&lt;td&gt;110,596&lt;/td&gt;
&lt;td&gt;1.37x&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Overall: &lt;strong&gt;1.65x&lt;/strong&gt; faster than the Python original, averaged across an 8-file workload spanning WAV/AIFF/FLAC/MP3. That's not dramatic, and I'm not going to pretend it is. Both implementations do the same fundamentally small, byte-shuffling work — parsing a WAV chunk header or an ID3v2 frame is a handful of comparisons and a slice index, not a hot numeric loop where Rust routinely wins by 10-50x over CPython. The pattern that does show up consistently: files with more tag frames to walk (&lt;code&gt;UTF16.mp3&lt;/code&gt;, 1.37x) show a smaller speedup than files that are mostly audio-property parsing with few or no frames (&lt;code&gt;vbr_xing_header.mp3&lt;/code&gt;, 2.00x) — consistent with per-frame Python interpreter overhead being the more meaningful cost driver here, not some inherent parsing-algorithm gap. Real, reproducible, not cherry-picked, and the honest headline is "correctly and safely faster," not "wildly faster."&lt;/p&gt;

&lt;h2&gt;
  
  
  🚧 The One Thing I Couldn't Fix
&lt;/h2&gt;

&lt;p&gt;One disclosed, un-fixed edge case: AIFF's extended-precision sample rate can, on sufficiently corrupted input, exceed &lt;code&gt;u32::MAX&lt;/code&gt;. Python's arbitrary-precision &lt;code&gt;int&lt;/code&gt; represents that value exactly (values like 10³³ Hz have shown up under fuzzing — obviously not a real sample rate). Rust's &lt;code&gt;samplerate: u32&lt;/code&gt; genuinely cannot. Rather than wrapping to garbage via a lossy cast, this port declines the value (&lt;code&gt;None&lt;/code&gt;) when it would overflow. It's a real language-capability limit, not a bug — and it's rare enough that a typical 65-second fuzz run doesn't always hit it, but no real-world AIFF file comes anywhere near this range either (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md #15&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;You might expect an "unsafe block I couldn't remove" story here — there isn't one. This port has zero &lt;code&gt;unsafe&lt;/code&gt; blocks; byte-level tag parsing doesn't need raw pointers, and the format-tree traversal work stayed entirely inside safe, bounds-checked slices the whole way through. The equivalent trade-off isn't a memory-safety compromise, it's the one directly above: a case where "faithful to Python's exact output" and "representable in Rust's type system" genuinely conflict, and something had to give. That's the actual cost of this port, not an unsafe block.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔄 The Decision I'd Take Back
&lt;/h2&gt;

&lt;p&gt;If I'm honest about one call I got wrong: I started the fuzz and benchmark harnesses in Python.&lt;/p&gt;

&lt;p&gt;That felt reasonable at the time — the harness needs to spawn a reference Python process anyway, so writing the orchestration logic (mutate a fixture, run both sides, diff the output, report) in Python too meant one language for that whole layer, ~369 lines split across &lt;code&gt;fuzz/diff_fuzz.py&lt;/code&gt; and &lt;code&gt;bench/run_bench.py&lt;/code&gt;. It worked. It just wasn't fast, because every single fuzz case meant spawning a fresh Python subprocess — and that per-case process-spawn cost dominated the actual work being measured.&lt;/p&gt;

&lt;p&gt;Partway through, I rewrote both as Rust binaries (&lt;code&gt;src/bin/fuzz_harness.rs&lt;/code&gt;, &lt;code&gt;src/bin/bench.rs&lt;/code&gt;) that spawn Python exactly once and feed it an embedded reference-oracle script, instead of once per case. Same total amount of "real Python running real Python code" — just amortized across the whole run instead of paid per-case. The result wasn't just cleaner: the Rust-orchestrated harness ran roughly &lt;strong&gt;2x more cases in the same wall-clock time&lt;/strong&gt;, and that extra throughput is &lt;em&gt;directly&lt;/em&gt; how two of the twelve bugs above (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;#14a, #14b&lt;/a&gt;) got found at all — the original Python-orchestrated version's slower cases-per-second never reached them inside a qualifying run's time budget.&lt;/p&gt;

&lt;p&gt;If I started over, the harness would be a Rust binary from the first commit, not a mid-build rewrite. Not because the Python version was wrong — it worked, it just quietly capped how many bugs I was going to find, and I didn't realize that was the cost until I'd already paid it.&lt;/p&gt;

&lt;h2&gt;
  
  
  📼 Watch It Live
&lt;/h2&gt;

&lt;p&gt;Full video walkthrough: &lt;a href="https://youtu.be/Hg3GoT8XJr0" rel="noopener noreferrer"&gt;youtu.be/Hg3GoT8XJr0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Plus six ~30-second recorded terminal demos (one per format) and the full test-suite-and-fuzz-run, captured for real, not staged:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flrjlhyv84qge9y0kpcr7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flrjlhyv84qge9y0kpcr7.gif" alt="Terminal recording of the full cargo test suite passing and a live differential fuzz run against the vendored Python reference, ending with zero divergences" width="800" height="699"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The other six — WAV, AIFF, FLAC, MP3, Ogg, MP4 — are in &lt;a href="https://github.com/GauravS13/tinytag-rs/tree/main/public/demo" rel="noopener noreferrer"&gt;public/demo/&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 All the Numbers in One Place
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;177/177&lt;/strong&gt; tests passing, traced 1:1 from upstream's own test data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;9,549 cases, 65 seconds, 0 divergences&lt;/strong&gt; on the last differential fuzz run&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;34&lt;/strong&gt; documented architectural decisions (&lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0&lt;/strong&gt; &lt;code&gt;unsafe&lt;/code&gt; blocks, &lt;strong&gt;0&lt;/strong&gt; dependencies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3&lt;/strong&gt; real bugs found in the original, reproduced faithfully&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;12&lt;/strong&gt; bugs the fuzzer found in this port during development, all fixed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1.65x&lt;/strong&gt; average speedup, honestly measured, honestly reported&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every decision, including the ones that were wrong on the first attempt, is in &lt;a href="https://github.com/GauravS13/tinytag-rs/blob/main/DECISIONS.md" rel="noopener noreferrer"&gt;DECISIONS.md&lt;/a&gt; — 34 of them, not a highlight reel.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧 Go Poke at It Yourself
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/GauravS13/tinytag-rs.git
&lt;span class="nb"&gt;cd &lt;/span&gt;tinytag-rs
cargo &lt;span class="nb"&gt;test&lt;/span&gt;                                              &lt;span class="c"&gt;# 177 tests, traced 1:1 from upstream&lt;/span&gt;
cargo build &lt;span class="nt"&gt;--release&lt;/span&gt; &lt;span class="nt"&gt;--bin&lt;/span&gt; fuzz_harness &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; ./target/release/fuzz_harness 65   &lt;span class="c"&gt;# run the fuzz yourself&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Full source, tests, DECISIONS.md, and the fuzz/bench harnesses: &lt;a href="https://github.com/GauravS13/tinytag-rs" rel="noopener noreferrer"&gt;github.com/GauravS13/tinytag-rs&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Submission by Siddhivinayk for &lt;a href="https://coderesurrection.com/2026/" rel="noopener noreferrer"&gt;Port Mortem / Code Resurrection 2026&lt;/a&gt;, Track D (Python → Rust).Tagging &lt;a class="mentioned-user" href="https://dev.to/partnerships_raptors"&gt;@partnerships_raptors&lt;/a&gt; &lt;/p&gt;

</description>
      <category>hackathonraptors</category>
      <category>portmortem</category>
      <category>python</category>
      <category>rust</category>
    </item>
  </channel>
</rss>
