<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[AheadKit]]></title><description><![CDATA[AheadKit (aheadkit.me) publishes plain-English programming books for absolute beginners — Python, JavaScript, C++, Java, SQL and more, from $2.99, with free chapters to read before you buy.]]></description><link>https://aheadkit.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6ae4ec5d4e14ac3dd14cd7fc/19ffbaa5-1ea5-44d3-87de-38872ccdcf94.png</url><title>AheadKit</title><link>https://aheadkit.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 00:51:20 GMT</lastBuildDate><atom:link href="https://aheadkit.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[A Spreadsheet Where Every Cell Is a Reaktiv Signal]]></title><description><![CDATA[The headline going around calls Reaktiv a spreadsheet where every cell is Python. The package on PyPI says something else: signals for Python, inspired by…]]></description><link>https://aheadkit.hashnode.dev/a-spreadsheet-where-every-cell-is-a-reaktiv-signal</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/a-spreadsheet-where-every-cell-is-a-reaktiv-signal</guid><category><![CDATA[Python]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Mon, 23 Nov 2026 01:40:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/9209dc66-3012-4eb2-9832-99d6050c0305.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The headline going around calls Reaktiv a spreadsheet where every cell is Python. The package on PyPI says something else: signals for Python, inspired by Angular Signals and SolidJS, version 0.25.0. There is no spreadsheet in it. So I built the spreadsheet the headline describes, out of the signals the package actually ships, and measured what happens. The small version works exactly as advertised. The big version breaks at a depth a real spreadsheet would hit without trying.</p>
<p>A cell is a signal, a formula is a computed value that reads other cells. Four cells, price times quantity with tax:</p>
<pre><code class="language-python">from reaktiv import signal, computed

price = signal(12.50)
qty = signal(4)
total = computed(lambda: price() * qty())
with_tax = computed(lambda: total() * 1.20)
</code></pre>
<p><code>total()</code> reads 50.0, <code>with_tax()</code> reads 60.0. The interesting part is not the arithmetic, it is when the arithmetic runs. I wrapped the total in a counting function and watched the recompute count. First read: one recompute. Change the price from 12.50 to 13.00 and read again: two recomputes, and the value is 52.0. Set the price to 13.00 a second time, the same value it already holds, and read again: still two. Read once more without changing anything: still two. The evaluation is lazy and exact. Nothing recomputes until it is read, nothing recomputes when nothing changed, and a value set to itself is not a change.</p>
<p>A diamond is the first real test of a reactive system: two formulas read the same cell, a third reads both of them, and the question is whether the shared work runs once or twice.</p>
<pre><code class="language-python">base = signal(100)
left = computed(lambda: base() + 10)
right = computed(lambda: base() * 2)
top = computed(lambda: left() + right())
</code></pre>
<p>Set base to 165, read top: 165 + 10 is 175, 165 times 2 is 330, top is 505. The counting version of this sheet says the shared cell recomputed exactly once per real change. Set base to 235, read again: 705. Set it to 305: 905. One recompute each time, never two, never zero. The diamond is clean.</p>
<p>Then I built a chain. One cell, then a computed that adds one, then another that adds one to that, and so on, and timed a read at the far end.</p>
<table>
<thead>
<tr>
<th>Chain depth</th>
<th>Read time</th>
</tr>
</thead>
<tbody><tr>
<td>10</td>
<td>0.08 ms</td>
</tr>
<tr>
<td>50</td>
<td>0.31 ms</td>
</tr>
<tr>
<td>100</td>
<td>0.69 ms</td>
</tr>
<tr>
<td>150</td>
<td>1.24 ms</td>
</tr>
</tbody></table>
<p>Linear, and fast. A hundred and fifty cells deep, a read costs a millisecond. A real spreadsheet would be happy with that. Then I pushed it to 200.</p>
<p>It broke. Not slowly, not with a warning. <code>RecursionError: maximum recursion depth exceeded</code>, twice, on two separate runs, at exactly the same depth. The recompute walks the dependency chain by calling itself, and Python's default limit of a thousand frames runs out somewhere around two hundred cells of nesting, because each level costs several frames. A chain of 150 cells is a toy. A chain of 200 is a broken toy. A real spreadsheet with a column of running totals, a budget that accumulates month by month, a project plan where each row depends on the one above, hits 200 rows before lunch.</p>
<p>The fix is not complicated, and it is not mine to claim as a discovery: evaluate the graph iteratively, or raise the recursion limit and accept the stack cost, or flatten the chain. What matters is that the headline version of this package, the spreadsheet where every cell is Python, needs that fix before it is a spreadsheet, because the version on PyPI today stops at a depth a real sheet reaches without trying. The small version works exactly as advertised. The big version is a recursion limit wearing a spreadsheet's clothes.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Valkey 9.2's B+ Tree Sorted Sets, Measured]]></title><description><![CDATA[The Valkey 9.2 release notes say large sorted sets now use 36% to 43% less memory per member. I built 9.2.0 from source, built 8.0.13 from source on the…]]></description><link>https://aheadkit.hashnode.dev/valkey-9-2-s-b-tree-sorted-sets-measured</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/valkey-9-2-s-b-tree-sorted-sets-measured</guid><category><![CDATA[valkey]]></category><category><![CDATA[Redis]]></category><category><![CDATA[Databases]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Sun, 22 Nov 2026 05:35:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/1396912b-3bd3-47fd-b744-3602e7f3f6eb.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Valkey 9.2 release notes say large sorted sets now use 36% to 43% less memory per member. I built 9.2.0 from source, built 8.0.13 from source on the same box, loaded the same million members into both, and measured. The saving I got was bigger than the claim, and my first reaction was that I had measured something wrong.</p>
<p>I had. Not the totals, which held up on a second run. What was off was what the numbers mean. The claim counts the index alone. My numbers count the whole key. Once you separate the two, the story gets more interesting than the headline, and less flattering in one specific place.</p>
<p>The setup is deliberately boring. One sorted set, a million members, each member a 20-byte name, scores running 1 to 1,000,000. I loaded it twice on each version: once in order, once shuffled. Both servers ran with the same settings, same allocator, same box, a small shared-CPU virtual machine, which matters for the throughput part below and not at all for the memory part. I read memory two ways for each load: the per-key figure and the server's own used-memory counter before and after. The two agreed within a couple of bytes per member, so I will quote the per-key figure and mention the other where it matters.</p>
<p>Here is the table that made me suspicious.</p>
<table>
<thead>
<tr>
<th>Load</th>
<th>Valkey 9.2</th>
<th>Valkey 8.0</th>
<th>Saved</th>
</tr>
</thead>
<tbody><tr>
<td>Sequential, 1M members</td>
<td>58.41 bytes/member</td>
<td>99.59 bytes/member</td>
<td>41.18 bytes/member, 41.4%</td>
</tr>
<tr>
<td>Random order, 1M members</td>
<td>62.30 bytes/member</td>
<td>99.59 bytes/member</td>
<td>37.29 bytes/member, 37.4%</td>
</tr>
</tbody></table>
<p>Two things jump out. First, the percentages land inside the claimed 36–43% band almost exactly: 41.4% sequential, 37.4% random order. Second, the absolute saving, 37 to 41 bytes per member, is roughly double what the claim implies. The release notes put the old index overhead at 50.3 bytes per member and the new one at 28.5 to 32.0, a saving of 18 to 22 bytes. My saving is twice that. Either the claim understates the win, or something else changed between 8.0 and 9.2 besides the sorted-set index.</p>
<p>Something else changed. To find what, I loaded the same million names as a plain set, same members, no scores, no index at all, on both versions. A set is just the member table plus the strings, so it tells me what the shared parts cost before the index enters the picture.</p>
<table>
<thead>
<tr>
<th>Structure</th>
<th>Valkey 9.2</th>
<th>Valkey 8.0</th>
</tr>
</thead>
<tbody><tr>
<td>Set, 1M members</td>
<td>50.88 bytes/member</td>
<td>38.79 bytes/member</td>
</tr>
</tbody></table>
<p>The new version's member table costs about 12 bytes per member MORE than the old one. Valkey 9.x replaced the old hash table with a new implementation, and on this load it is hungrier, not leaner. That flips the arithmetic: the total saving of 37 to 41 bytes is the fbtree's index saving MINUS the 12 bytes the new table gave back. The index itself must have saved roughly 49 to 53 bytes per member. That is more than the entire old index overhead the release notes quote.</p>
<p>I do not have a clean explanation for that gap, and I am not going to invent one. The release notes measured 5 million members on a 64-core machine with their own method; I measured 1 million on a small box with the per-key counter. Allocator rounding alone can move these figures by several bytes per member: a 56-byte node rounds up to a 64-byte size class, and a 60-byte node the same way, so two structures that differ by a few bytes on paper can differ by a whole size class in practice. What I can say with confidence is the thing a person upgrading actually cares about: the whole key got 37% to 41% smaller, and the index is not the only thing that moved. If you sized your fleet from the old per-member figure, the new total is what you will actually pay, and it is smaller than the claim's arithmetic suggests, not larger.</p>
<p>The release notes make a second claim about the new tree: it compacts sparse leaves when members are deleted, so a set that shrinks gives memory back. I tested that by deleting half the random-order set, 500,000 members out of a million, and measuring again.</p>
<p>On 9.2, deleting half the members freed 23.1 MB of the set's 62.3 MB, about 37%. On 8.0, the same deletion freed 45.6 MB of 99.6 MB, about 46%. In absolute terms the 9.2 set left behind is still far smaller, 39.2 MB for the remaining half-million against 54.0 MB on 8.0, but the new tree did not give back a bigger share than the old skiplist did. The reason is visible in the per-member cost of what remains: 78.43 bytes on 9.2 against 107.98 on 8.0. A fixed chunk of the cost is the member table, and that table does not shrink when members leave. Deleting half the members removes half the index, but the table stays the size it was built for. The compaction claim is about the tree, and the tree is only part of the key. Anyone planning to reclaim memory by deleting members should expect roughly a third of the set's memory back on 9.2, not half.</p>
<p>The third claim in the release notes is throughput: ZADD up 105%, ZREM up 76%. I could not reproduce any of that here, and the reason is probably my setup rather than their numbers. I loaded a million members with one client, sending them in batches of a thousand, and timed it twice per version. The times were 5.59 and 5.11 seconds on 9.2, 5.17 and 7.48 seconds on 8.0. The spread inside one version is bigger than the gap between versions. On a small shared-CPU box with one client, the load is limited by everything except the index: the client, the connection, the scheduler. Their numbers came from nine I/O threads and ten commands in flight at once on a 64-core machine. If your workload looks like mine, one client doing bulk loads, do not upgrade for speed. If it looks like theirs, my numbers say nothing about it either way.</p>
<p>So where does that leave the upgrade? The memory win is real, it is bigger than the headline in total terms, and it survives the most boring possible test: same data, same box, two versions, measured twice. The two caveats are the kind that only show up when you measure the whole key instead of the index: the new member table costs more than the old one, which means the tree is doing even more work than the release notes say, and deleting members gives back less than half the memory because the table does not shrink. Neither changes the decision. Both change the capacity maths you do after it.</p>
<p>I went in expecting to confirm a percentage. I came out with a different number than the one in the release notes, a member table that got more expensive while nobody was looking, and a deletion test that gives back a third instead of a half. The percentage checked out. The details did not, and the details are what you pay for.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[By-Value Bundles Close the Hole the ID Assertion Cannot See]]></title><description><![CDATA[Last week I wrote that the ID check was the fix. Two IDs and one comparison, and it caught the only failure that mattered: four swaps, four fires, while…]]></description><link>https://aheadkit.hashnode.dev/by-value-bundles-close-the-hole-the-id-assertion-cannot-see</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/by-value-bundles-close-the-hole-the-id-assertion-cannot-see</guid><category><![CDATA[AI]]></category><category><![CDATA[RAG ]]></category><category><![CDATA[Python]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Sun, 22 Nov 2026 05:33:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/c593d5a1-6918-4656-9c14-b271e8289303.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Last week I wrote that the ID check was the fix. Two IDs and one comparison, and it caught the only failure that mattered: four swaps, four fires, while the timing check stayed green through all of them. That was true for the failure I had built. It is not true for the failure Ahmet Özel built next.</p>
<p>His question had two halves. The first half is the one I already ran: compare the retrieved document ID against the consumed ID at the boundary, and any accidental swap becomes a hard failure instead of a plausible-looking wrong answer. The second half is new. Pass the retrieved document to generation by value, as an immutable bundle, instead of handing over the object itself. Version 3 of my flow already hands generation the object instead of the shared slot, and the swaps stop mattering — so does by-value add anything on top of that? I ran it, and the answer is yes, because the two halves guard against different failures.</p>
<p>The failure by-value closes is not a swap. It is an edit. A swap replaces which document generation reads. An edit keeps the same document and rewrites its text in place. The ID is a field on the object, and an in-place edit of the text does not touch the ID, so the ID comparison still passes. The check I trusted cannot see this failure at all. That is the hole, and it is worth stating plainly before the numbers: a check that compares IDs can only catch a change of object. It is blind to a change inside the object.</p>
<p>The setup is the same one from last week so the two runs compare directly. Six support documents for a small shop, including two versions of the refund policy, the superseded one promising 30 days and the current one 14. A keyword retriever picks by overlap, ties break to the newest version, and generation quotes whatever document it is handed. Eight fixed questions. On four of them — the same four queries as last week's swap set — a second retrieval for an unrelated question lands between retrieval and generation. Last week it overwrote the shared slot. This week it edits the handed document object in place, writing the other document's text into it. Generation then runs two ways: consuming the same object retrieval returned, or consuming a bundle taken at the retrieval boundary.</p>
<p>The bundle is a deep copy of the retrieved document, frozen so nothing downstream can edit it either:</p>
<pre><code class="language-python">import copy
from types import MappingProxyType

def take_bundle(result):
    return MappingProxyType(copy.deepcopy(result))
</code></pre>
<p>The copy is taken the moment retrieval returns. Anything that edits the original afterwards edits a document nobody quotes.</p>
<table>
<thead>
<tr>
<th>Scenario</th>
<th align="right">Wrong answers</th>
<th align="right">ID check fired</th>
</tr>
</thead>
<tbody><tr>
<td>by-reference, no edit</td>
<td align="right">0 of 8</td>
<td align="right">0</td>
</tr>
<tr>
<td>by-reference, edited mid-flight</td>
<td align="right">4 of 8</td>
<td align="right">0</td>
</tr>
<tr>
<td>by-value bundle, edited mid-flight</td>
<td align="right">0 of 8</td>
<td align="right">0</td>
</tr>
<tr>
<td>by-value bundle, no edit</td>
<td align="right">0 of 8</td>
<td align="right">0</td>
</tr>
</tbody></table>
<p>Read the second row twice, because it is the whole piece. Four of the eight answers are wrong, all four on the edited queries, and the ID check fired on none of them. The worst one is the same shape as last week's worst one: "how many days can I get a refund" retrieved the current policy at 14 days, and generation quoted the shipping document at 3–5 business days. Same wrong answer, different hole. The retrieved ID and the consumed ID still match, because they are the same object, and the object now holds different text than it did when retrieval returned it. The comparison I added last week looks at the label on the box. The edit changed what is inside the box.</p>
<p>The third row is the answer to Ahmet Özel's question. Under the same four edits, the by-value bundle gives zero wrong answers. The edits still happen — they land on the original object, which is still sitting there with its text rewritten — but generation holds its own copy from the boundary, and the copy never changes. The frozen part matters too, in a smaller way: a write aimed at the bundle itself raises a TypeError instead of landing silently, so the bundle cannot be edited by the same kind of accident it protects against.</p>
<p>So does by-value add anything on top of handing generation the object? It adds the half the ID check cannot cover. Handing generation the object instead of the slot fixes who generation reads from: no other step can swap the document out from under it. Passing it by value fixes what generation reads: the text is frozen at the boundary, so anything that edits the original afterwards is editing a document nobody quotes. The two checks sit at the same boundary and catch different failures. The ID comparison catches a swap, and it caught four out of four last week. The bundle catches an edit, and it caught four out of four this week. Neither replaces the other, and both are cheap: one comparison, one copy at one boundary. I am keeping both.</p>
<p>The check I trusted catches the swap. It does not catch the edit. The bundle catches the edit, and nothing else in the flow needed to change.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Snapshot the Shared State After Every Test]]></title><description><![CDATA[The fixture adds one failure to the forward run. That is the result, and it is the good one. AI Developer left the follow-up on my reverse-order piece, and…]]></description><link>https://aheadkit.hashnode.dev/snapshot-the-shared-state-after-every-test</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/snapshot-the-shared-state-after-every-test</guid><category><![CDATA[Testing]]></category><category><![CDATA[Python]]></category><category><![CDATA[pytest]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Sun, 22 Nov 2026 05:19:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/17bb8317-d435-4e22-9eab-d89ff1f78df9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The fixture adds one failure to the forward run. That is the result, and it is the good one.</p>
<p>AI Developer left the follow-up on my reverse-order piece, and it had two parts. First, stop treating order as a single sample: run a few seeded random orders and log the seed, so failures sort themselves into order-dependent and stable. Second, add a fixture that snapshots the shared module state after every test and asserts it is unchanged, so the sale-test leak fails at its source instead of in a victim file. I did both on the same twelve-test suite from that piece: the pricing module with its shared discount, the polluter test that sets it and puts it back, the sale test that sets it to 0.5 and never restores it, the four victim tests that expect full price, and the boundary file with the one-character shipping bug at exactly $100.00.</p>
<p>The fixture is small. It sits in <code>conftest.py</code>, runs for every test, and compares the shared state after the test with the state before it:</p>
<pre><code class="language-python">import pricing
import pytest

@pytest.fixture(autouse=True)
def snapshot_fixture():
    before = (pricing.DISCOUNT, pricing.FREE_SHIPPING_THRESHOLD)
    yield
    after = (pricing.DISCOUNT, pricing.FREE_SHIPPING_THRESHOLD)
    assert after == before, (
        f"shared module state changed during this test: "
        f"before={before} after={after}"
    )
</code></pre>
<p>I ran five orders — forward, reverse, and three seeded shuffles of the twelve tests — each once with the fixture and once without it. Ten pytest runs, twelve tests each. The runs without the fixture reproduce the earlier piece exactly: forward 8 of 12 passing, reverse 11 of 12. The suite is unchanged, so the fixture is the only difference in the numbers below.</p>
<table>
<thead>
<tr>
<th>Order</th>
<th align="right">Without the fixture</th>
<th align="right">With the fixture</th>
</tr>
</thead>
<tbody><tr>
<td>forward</td>
<td align="right">8 passed / 4 failed</td>
<td align="right">7 passed / 5 failed</td>
</tr>
<tr>
<td>reverse</td>
<td align="right">11 passed / 1 failed</td>
<td align="right">9 passed / 3 failed</td>
</tr>
<tr>
<td>seed 1</td>
<td align="right">8 passed / 4 failed</td>
<td align="right">6 passed / 6 failed</td>
</tr>
<tr>
<td>seed 7</td>
<td align="right">7 passed / 5 failed</td>
<td align="right">5 passed / 7 failed</td>
</tr>
<tr>
<td>seed 42</td>
<td align="right">8 passed / 4 failed</td>
<td align="right">6 passed / 6 failed</td>
</tr>
</tbody></table>
<p>Every run gets worse with the fixture, and every run gets more honest. The forward run gains exactly one failure, and it is the one AI Developer asked for: the sale test itself, failing in its own file with the teardown error <code>shared module state changed during this test: before=(0.0, 100.0) after=(0.5, 100.0)</code>. Before the fixture, the sale test never failed anywhere. Only its victims did, three totals halved by a discount they never set. Now the leak is counted at its source as well as in the victims. The victim tests still fail — the fixture points at the leak, it does not clean it up — so the count goes up by one, and that is the direction a leak should push a count.</p>
<p>The reverse run is where the fixture shows its edge. It goes from one failure to three, and the two new ones are not new bugs. One is the sale test again, failing at its source like everywhere else. The other is the polluter test, the one with the <code>finally</code> clause that puts the discount back. It entered with the discount already dirty at 0.5, because the sale test ran first, restored it to 0.0, and the fixture flagged the change anyway: <code>before=(0.5, 100.0) after=(0.0, 100.0)</code>. A snapshot against the test's entry state cannot tell a leak from a cleanup when the test entered dirty. The polluter did the right thing and failed for it. That is a real wart in the fixture as written, and it shows up in every order where the sale test runs before the polluter — reverse and all three seeds. Comparing against the module's known starting value instead of the entry value would spare the cleanup test, but it would flag the victim tests instead, since they inherit the dirty state without changing it. Either comparison has a blind corner. The entry comparison at least names the test that moved the state, and in the forward order it names the right one.</p>
<p>The seeded orders earn their place in a different way. The two exact-$100.00 cart-total tests pass in both forward and reverse, with and without the fixture — and fail in the seeded orders: the two-item cart in seed 1 and seed 42, the single-item cart in seed 7. They only fail when they run after the sale leak, and neither the forward nor the reverse order puts them there. Two orders are one sample. Five orders are a bucket, and the bucket caught two tests that the forward and reverse runs both called healthy.</p>
<p>With five orders logged, the split AI Developer asked for writes itself:</p>
<table>
<thead>
<tr>
<th>Test</th>
<th align="right">Fails in</th>
<th>Bucket</th>
</tr>
</thead>
<tbody><tr>
<td>exact-$100.00 free shipping</td>
<td align="right">all 5 orders</td>
<td>stable</td>
</tr>
<tr>
<td>sale-test leak (fixture)</td>
<td align="right">all 5 orders</td>
<td>stable</td>
</tr>
<tr>
<td>three victim totals</td>
<td align="right">3–4 orders each</td>
<td>order-dependent</td>
</tr>
<tr>
<td>two exact-$100.00 cart totals</td>
<td align="right">1–2 orders each</td>
<td>order-dependent</td>
</tr>
<tr>
<td>polluter cleanup test (fixture)</td>
<td align="right">4 orders</td>
<td>order-dependent</td>
</tr>
<tr>
<td>three polite boundary values, empty cart</td>
<td align="right">no order</td>
<td>always passing</td>
</tr>
</tbody></table>
<p>Two failures never move. The exact-$100.00 shipping test is the real billing bug, the one-character swap, failing forward, backward, and shuffled. The sale-test leak is stable too, which is the part worth sitting with: the leak itself is order-independent, and only its victims move. The six order-dependent failures are all symptoms of it — three victims, two cart totals, and the cleanup test the fixture catches in the act of sweeping up. The four that never fail are the polite values around the boundary and the empty cart, which totals zero under any discount and so cannot fail at all.</p>
<p>Five orders, one fixture, and the split is now written down instead of guessed at. The leak fails in every order, in its own file. The victims are the ones that move. That was the ask, and it is done.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Run the Suite Backwards. The 100.00 Cart Breaks First.]]></title><description><![CDATA[nexusverify left a short challenge on my test-pollution piece: run the suite in reverse order, and bring the exactly-$100.00 cart with you. The polite test…]]></description><link>https://aheadkit.hashnode.dev/run-the-suite-backwards-the-100-00-cart-breaks-first</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/run-the-suite-backwards-the-100-00-cart-breaks-first</guid><category><![CDATA[Testing]]></category><category><![CDATA[Python]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[TDD (Test-driven development)]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Sat, 21 Nov 2026 03:32:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/85925be0-6e77-4732-bd64-12f98580d65b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>nexusverify left a short challenge on my test-pollution piece: run the suite in reverse order, and bring the exactly-$100.00 cart with you. The polite test values never catch the boundary swap, he said, and mutant 10, a billing bug, was the proof. I took the suite from that November 12 run, added his fixtures, and ran it both ways. The reverse run did not just fail differently. It failed less, and that is the scarier result.</p>
<p>The suite is small on purpose. Twelve tests across four files. The November 12 originals are still in there: a pricing module with a shared DISCOUNT, a polluter test that sets it and puts it back, and four victim tests that expect full price. I added two files. One is a sale test that sets the discount to 0.5 and never restores it. It is the same shared-state leak the November 12 run fixed in the polluter file, still sitting in a different file. The other is a boundary file: free shipping starts at $100.00, tested at $99.99, $100.01, $150.00, and at exactly $100.00, plus two exact-$100.00 cart totals.</p>
<p>The billing bug is one character. Free shipping is implemented as a strict greater-than instead of greater-than-or-equal, so a $100.00 cart pays for shipping it should get free. The polite values around it cannot see that. $99.99 correctly pays, $100.01 correctly ships free, $150.00 correctly ships free, with the bug in place. Only the exact boundary value exposes the swap.</p>
<p>Forward first, the order the tests are collected in. Four failures out of twelve. Three of them are the victim tests: full price on a $200 cart came back as $100.00, a $50 item came back as $25.00, three items totalling $60 came back as $30.00. The sale test had leaked its 0.5 discount into the shared module before the victim file ran, and every total after it was halved. The fourth failure is the exact-$100.00 shipping test, returning false where the threshold says free.</p>
<p>Then the reverse order, same twelve tests, files passed in the opposite order. One failure out of twelve. The victim tests all pass. They run first now, before anything has had a chance to leak. The sale test still leaks its discount, same as before. But the fixed polluter test runs right after it, and its cleanup clause quietly sets the discount back to zero. By the time the boundary file runs, the leak is gone, as if it never happened.</p>
<p>Read that again, because it is the whole piece. The reverse run is greener, 11 of 12 instead of 8 of 12, and it is the run that hides a real bug. The leak is still in the suite. The reverse order just arranges for it to be cleaned up before any test can notice. A developer looking at the reverse result would see one failure, fix the shipping boundary, and walk away believing the suite is healthy. The forward result, uglier by three failures, is the honest one: it shows the leak for what it is.</p>
<p>The one test that fails in both orders is the exact-$100.00 shipping test, and that is what makes it a billing bug instead of a test-order artefact. Order-dependent failures move when the order moves. This one does not move. It fails forward, it fails backward, it fails on its own. The boundary swap is in the code under test, not in the test order, and the only value that finds it is the exact $100.00.</p>
<p>That split is the useful thing the reverse run gives you. Run both orders, and sort the failures into two piles. The ones that move are order dependence: shared state leaking between tests, and the fix is isolation, not a different order. The ones that stay put are real bugs, and the exact-$100.00 cart is the example: a one-character swap that three polite values sailed straight past. One test passed in both orders for a reason worth noticing: the empty cart totals zero under any discount, so no leak can touch it. A test that cannot fail is not evidence either.</p>
<p>Two habits follow from this, and both are cheap. First, test money at the boundary itself, not just either side of it. $99.99 and $100.01 are polite values. They confirm the threshold exists. They cannot confirm which side of it the boundary sits on, and that is the side the customer pays for. Second, run the suite backwards sometimes, but read the result the right way round. A greener reverse run is not a healthier suite. It can be the same suite with its leaks swept under the order, and the only test that tells you the truth in both directions is the one that fails in both.</p>
<p>nexusverify was right about the cart. The $100.00 value caught the bug that nothing else in the suite could see. He was also right, in a way he may not have meant, about the reverse run: it did not catch the leak. It hid it, and looked better doing it.</p>
<p>What does your suite do when you run it backwards — same failures, different ones, or suspiciously fewer?</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[The Steps Ran in Order. Generation Still Read the Wrong Document.]]></title><description><![CDATA[raju_dandigam left a comment on my retrieval piece that stuck with me. The order check I had in place only proves the steps ran in sequence. It cannot tell…]]></description><link>https://aheadkit.hashnode.dev/the-steps-ran-in-order-generation-still-read-the-wrong-document</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/the-steps-ran-in-order-generation-still-read-the-wrong-document</guid><category><![CDATA[AI]]></category><category><![CDATA[RAG ]]></category><category><![CDATA[Testing]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Sat, 21 Nov 2026 03:30:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/5f4090e7-c9d4-4473-bfb0-59cd49eddc23.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>raju_dandigam left a comment on my retrieval piece that stuck with me. The order check I had in place only proves the steps ran in sequence. It cannot tell me whether generation actually used what retrieval returned. His suggestion was plain: record the retrieval result's ID and the ID actually handed to generation, then compare the two in an application assertion. If the IDs ever disagree, something swapped the result between the two steps, no matter how tidy the timestamps look.</p>
<p>I built the check into a small retrieval setup and ran it. The result is the kind of thing that makes you distrust every green ordering check you have ever shipped.</p>
<p>The setup is a keyword retriever over six support documents for a small shop: refund policy, shipping times, warranty, return labels, privacy, order records. Two versions of the refund policy sit in the set on purpose, a superseded one promising 30 days and the current one promising 14. Generation is a consumer that quotes the document it is handed. Nothing here calls a model. The retriever picks by keyword overlap, ties break to the newest version, and generation quotes whatever document it receives. That is the whole system, and it is enough to show the failure.</p>
<p>The failure needs one more piece. In the version of the flow I tested first, generation does not receive the retrieval result directly. It reads a shared "current document" slot, and retrieval writes that slot. That shape is everywhere in real code: a module-level variable, a context object, a cache entry that the next step trusts. It works fine until anything else writes to the same slot between the two steps.</p>
<p>So I ran eight fixed questions through three versions of the flow. First, the clean version: retrieval writes the slot, generation reads it, nothing else touches it. Eight questions, zero mismatches. The ID assertion passes on all eight, and so does the timing check. Nothing surprising.</p>
<p>Then the version with the swap. On four of the eight questions, a second retrieval for an unrelated question lands between retrieval and generation and overwrites the shared slot. Retrieval still runs before generation on every single question. The timestamps are in the right order. The timing check passes on all eight.</p>
<p>The ID assertion fires on four of the eight. Half the answers came from the wrong document.</p>
<p>The worst one is the kind of mistake a user would catch and a log would not. The question was "how many days can I get a refund". Retrieval returned the current refund policy, 14 days. Generation quoted the shipping document instead: 3–5 business days. A refund question answered with shipping times, delivered by a flow whose steps ran in exactly the right order. Two of the other mismatches did the same thing in the other direction: a return-labels question and another refund question both got the shipping document. The fourth handed a warranty question the superseded refund policy. Every one of them passed the timing check.</p>
<p>That is the point raju_dandigam was making, and the numbers make it hard to argue with. The timing check was silent on 4 out of 4 mismatches. The ID assertion caught 4 out of 4. Ordering proves sequence. It proves nothing about consumption, because consumption is a question about which object the next step held, and a timestamp cannot answer that.</p>
<p>The fix is the part that surprised me most, because it is small. In the third version I kept the same four swaps in place. The same second retrieval landed between the steps, the same shared slot got overwritten, and I changed one thing: generation consumes the retrieval result it was handed instead of reading the slot. Eight questions, zero mismatches. The swaps still happened. They just stopped mattering, because nothing generation quoted could be overwritten after retrieval returned it.</p>
<p>There is a temptation to read that as "the slot was the bug, delete the slot", and that is mostly right. But the deeper lesson is about where the check lives. The timing check lives outside the flow, watching timestamps. It can only ever say the steps ran in order, and order was never the thing that broke. The ID assertion lives inside the flow, on the actual objects passed between steps. It compares the ID retrieval returned with the ID generation consumed, and it fires the moment those two disagree, whatever the cause: a second retrieval, a stale cache entry, a variable reused for the next question before the last one finished.</p>
<p>That last one is worth naming, because it is the shape I expect to see most in real code. Two questions in flight at once, one slot, and the second question's retrieval lands a fraction of a second before the first question's generation. No error anywhere. The first answer quotes the second question's document, and the timing check signs off on all of it.</p>
<p>I am keeping the assertion. It is two IDs and one comparison, and it caught the only failure that mattered. The timing check stays too. It catches a different failure, steps running out of order, but I no longer trust it to say anything about what generation read. If you run a retrieval setup of your own, ask it one question: does the step that writes the answer hold the same ID retrieval returned? If you cannot answer that from inside the flow, you are trusting the timestamps. And the timestamps just told me four wrong answers were fine.</p>
<p>What has broken for you in this shape — the right order, the wrong document? I am curious how often it shows up outside my little test set.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[The Stale Pin That Fell Off a Cliff]]></title><description><![CDATA[alexgeorgiev17 ran the pinning test I had asked for, and his answer surprised me. He pinned the planner's own advice, shifted refunded orders from 0.5% to…]]></description><link>https://aheadkit.hashnode.dev/the-stale-pin-that-fell-off-a-cliff</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/the-stale-pin-that-fell-off-a-cliff</guid><category><![CDATA[postgres]]></category><category><![CDATA[Databases]]></category><category><![CDATA[performance]]></category><category><![CDATA[SQL]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Sat, 21 Nov 2026 03:28:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/858c57b6-e93b-4117-a6ed-9126af951e30.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>alexgeorgiev17 ran the pinning test I had asked for, and his answer surprised me. He pinned the planner's own advice, shifted refunded orders from 0.5% to 40%, and the stale pin degraded gently. Under load it even won. His guess for the next test was specific: a pinned nested loop whose outer side grows would probably be the one that really hurts. I ran that test, and he was right about the cliff. He was wrong about what the cliff means.</p>
<p>One honest note first: this ran on PostgreSQL 16.15, not 19. The distro repos for this box carry 16 and nothing newer, so 19 was not an option here. The behaviour below is about the shape of the plan, not the version number, and I would rather say the version plainly than pretend otherwise.</p>
<p>The setup mirrors his. Two hundred thousand orders, six hundred thousand order items, three per order. Refunded starts at 1,000 orders, 0.5% of the table. The pin is three settings that switch off hash joins, merge joins and sequential scans, which leaves the planner one shape: a nested loop with an index scan on the order status and an index lookup into the items for every outer row. The shift is an update that moves refunded to 80,600 orders, 40.3%, followed by a fresh analyse. Each combination ran for twenty seconds under pgbench, one client and ten.</p>
<p>Before the shift, the pinned plan is not roughly equal to the planner's plan. It is eleven times faster. Single client: 35.82 ms pinned against 409.95 ms for the planner's fresh plan. Ten clients: 71.49 ms against 819.96 ms. The planner picks a parallel hash join with a parallel scan of the items table, and on this box that choice is expensive. The machine has 1.5 shared CPUs, and two parallel workers plus the leader cost more than the scan saves. The pin, serial and boring, walks away with it. His run had the two plans about level before the shift. Mine did not, and the reason is the hardware under the database, not the query.</p>
<p>Then the shift, and this is where his guess lands. Single client, the pinned plan goes from 35.82 ms to 1,034.36 ms. That is 29 times slower. Ten clients, it goes from 71.49 ms to 2,500.34 ms, 35 times slower. The outer side grew from 1,000 rows to 80,600, and every one of those rows pays an index lookup into the items table. The plan medians tell the same story without the load: the pinned plan goes from 26.42 ms to 1,118.07 ms. That is a cliff, in the plain sense of the word. A query that answered in 36 ms now takes over a second.</p>
<p>But here is the part that changes the lesson. The planner's fresh plan degrades too, just less: 409.95 ms to 953.62 ms single client, 819.96 ms to 2,895.89 ms at ten. After the shift, the pinned plan is 8% slower than the planner's plan at one client and 14% faster at ten. The pin fell off a cliff and still tied the race. The cliff is measured against the pin's own past, not against the alternative. The query itself got eighty times more work, and no plan shape absorbs that for free.</p>
<p>I ran one more phase because his comment named it: after a CLUSTER, his two plans were basically a tie. Mine are too. Single client after clustering the orders table on the status index: 568.91 ms pinned against 608.74 ms planner. Ten clients: 2,320.08 ms against 2,216.14 ms. The tie holds, and the absolute numbers come down for both plans, which says the heap layout was part of what the shift cost. The update writes new row versions at the end of the heap, which flatters the index scan, and the cluster removes that flattery. Even with it removed, the pin does not lose.</p>
<p>So what do I actually take from this? Two things, and they point in opposite directions. First, a stale pin can fall off a cliff. Twenty-nine times slower single client, thirty-five at ten, from a data shift the pin cannot see. If your outer side can grow like that, the pin is a bet that it will not, and bets need watching. Second, the cliff is not the same as losing. The planner's fresh plan was the worse plan before the shift on this box, and it was no better after it. Pinning is not automatically the risky choice and trusting the planner is not automatically the safe one. The planner's parallel plan was a bad plan here before any data moved, and no amount of freshness fixes a plan the hardware cannot run cheaply.</p>
<p>The check I am keeping is simple, and it is the one his comment implies without stating it. Measure the pinned plan against the planner's plan, on your hardware, before and after the shift. The before number tells you what the pin is worth. The after number tells you what it costs. If the pin is eleven times faster before and level after, it was a good pin that aged badly, not a mistake. If it is level before and a cliff after, it was never worth pinning. The difference matters, and only the two measurements together show it.</p>
<p>Has a pinned plan ever bitten you this way, or has the planner handed you a worse plan than the pin you were afraid to keep?</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[How Many Runs Before You Trust the Gap Between Two Fixes]]></title><description><![CDATA[kenielzep97 asked a question in the comments that most people skip past, because it sounds like bookkeeping. He had run three fixes on the same scheduled…]]></description><link>https://aheadkit.hashnode.dev/how-many-runs-before-you-trust-the-gap-between-two-fixes</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/how-many-runs-before-you-trust-the-gap-between-two-fixes</guid><category><![CDATA[AI]]></category><category><![CDATA[agents]]></category><category><![CDATA[Testing]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Sat, 21 Nov 2026 03:26:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/c456087c-bf8a-49c0-a2e0-9ca7a07261bd.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>kenielzep97 asked a question in the comments that most people skip past, because it sounds like bookkeeping. He had run three fixes on the same scheduled runs — a sender line alone, a diary trim alone, and the two together — and he wanted to know how many runs per arm it takes before the difference between the two single fixes is believable, not assumed. The ranking has to stop flipping before you trust it. The network-shaping tool the original plan needed is not available on this machine, so this is the fallback version: the same three fixes, rebuilt on a triage task I could run here, measured at increasing run counts until the ranking settles.</p>
<p>The original experiment is kenielzep97's own. On his scheduled runs, adding one sentence saying who sent the message cut false claims from 20 of 23 down to 2 of 24. Trimming the diary cut them to 2 of 8 as well. He never tested the two together. I could not recover his run or his exact arm definitions from anything saved locally, so I rebuilt the shape on a task I already had: twelve triage reports, five issues each, and the model has to find the matching issue and name its label. The diary in this rebuild is four lines of notes from past runs, and two of those lines argue for the wrong issue. They tell the model that a crash report is probably issue 412, the safe answer. That is the diary arguing the wrong way, the way his did. The three fixes are the same as his, plus a control arm with neither fix, so the fixes have something to beat.</p>
<h2>1. The ranking never flips, and that is the answer and the problem</h2>
<p>At twelve runs per arm the order is diary trim 9 of 12, combo 7, control 4, sender line alone 1. At twenty-four it is 18, 14, 8, 2. At thirty-six it is 27, 21, 12, 3. The ranking does not flip once. The gap between the best and worst arm is eight tasks out of twelve, and no amount of extra runs overturns a gap that wide.</p>
<p>So the number is twelve, in the sense that one rep already separates the arms. But that is also the problem with the number. Every rep came back bit-identical to the first: same answers, same token counts, same loops. The model runs at temperature zero with a cached prompt, so the second and third reps are the first measurement repeated, not new evidence. Thirty-six runs per arm is one measurement counted three times. The ranking is stable from the first rep because nothing varies. A real flip-point needs reps that differ, and this setup cannot produce them. What the run proves is the size of the gap. It does not prove the run count that certifies it. Anyone who wants the honest N needs a setup where the runs wobble (a temperature above zero, more tasks, a bigger model) and then watches where the order stops moving. Here the order never moved, so the N that certifies it is unmeasured, not twelve.</p>
<h2>2. The diary trim is the fix. The sender line hurts.</h2>
<p>The diary trim alone solves 9 of 12. The control solves 4. The sender line alone solves 1, worse than doing nothing at all. The combo solves 7. Adding the sender line to the trimmed diary costs two solves. Adding it to the full diary costs three. The combo is not the best of both. It is the diary trim with a penalty attached.</p>
<p>That is the opposite of what kenielzep97 measured, and the difference is the failure, not the fix. His agent was misreading who sent a message, and a line saying who sent it fixed the misreading. This agent's failure is a diary arguing for the wrong issue, and a line about the sender does nothing about that. It just adds text for a small model to trip over. The sender line is a good fix for a provenance problem. It is a bad fix for a bad-diary problem, and on this rebuild it is worse than no fix at all.</p>
<h2>3. The mechanism is loops, and the diary trim ends them</h2>
<p>The fixation numbers barely move between arms. The diary trim ends with 6 fixations in 36 runs; the other three arms end with 9 each. What separates them is not which issue the model picks. It is whether it answers at all. Count the runs that burn all six calls without answering: diary trim, zero in 36. Combo, three. Control, fifteen. Sender line alone, twenty-four. The full diary makes the model re-list and re-read the same issues instead of deciding. Trimming it brings back the normal shape (three turns, about 2,068 tokens per task, the same baseline the plain trim run had). The sender line adds loops on top of the full diary: eight in the first rep alone. The combo inherits one loop from the sender line's share.</p>
<p>So the diary trim does not mainly fix the model's judgement. It fixes its ability to finish. A model that answers wrong 25% of the time is useful. A model that never answers 67% of the time is not, and that is what the full diary plus the sender line produces: 1 of 12 solved, 8 of 12 never answered.</p>
<h2>4. The bet on the combo loses</h2>
<p>The guess going in was that the combination would hold up best over a month of scheduled runs. On this rebuild it does not. Seven of twelve sits below nine, and the combo carries the sender line's cost without its benefit. If the two fixes stacked, the combo would lead. It trails by two solves at every run count, and the gap never closes.</p>
<p>The rule I am keeping is narrow. When two fixes address different failures, test them apart before you combine them, because the combination can cost more than either fix alone. And when someone asks how many runs it takes to trust a gap, ask first whether the runs vary at all. If they do not, the count is not the evidence. The size of the gap is, and the gap here is eight tasks out of twelve, fixed from the first rep.</p>
<p>Have you had a fix that looked obvious in one setup and made things worse in another, and how many runs did it take you to believe the second result?</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Storing Blobs in SQLite vs Plain Files: Reads Win, Writes Lose]]></title><description><![CDATA[The Hacker News post this week is Zerodha's: they store blobs in SQLite, and the thread has 248 points. The idea is attractive for anyone who has ever…]]></description><link>https://aheadkit.hashnode.dev/storing-blobs-in-sqlite-vs-plain-files-reads-win-writes-lose</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/storing-blobs-in-sqlite-vs-plain-files-reads-win-writes-lose</guid><category><![CDATA[SQLite]]></category><category><![CDATA[database]]></category><category><![CDATA[backend]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Fri, 20 Nov 2026 02:10:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/67d3ea5e-b64d-45d7-bf88-9499c7cbb8b2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Hacker News post this week is Zerodha's: they store blobs in SQLite, and the thread has 248 points. The idea is attractive for anyone who has ever managed a directory full of files: one file instead of thousands, transactions instead of hoping the write finished, a query instead of a directory walk. I built the small version to see what it actually costs: 500 blobs, 133.2 MiB total, real bytes sliced from C source and Markdown on this machine, stored in SQLite with WAL mode and in a plain directory, every read verified against a checksum.</p>
<p>The result is a split decision, and the split is clean enough to state plainly. SQLite reads faster. Files write faster. And the random reads are a wash, which is the result I did not expect.</p>
<h2>The setup</h2>
<p>500 blobs: 100 each of 4 KiB, 16 KiB, 64 KiB, 256 KiB, and 1 MiB, 133.2 MiB in total. The SQLite side is one table, one blob column, WAL journal mode, synchronous set to normal. The file side is 500 files in one directory. Both sides hold the same bytes. Every read checks the checksum, so a fast wrong answer would not count. SQLite 3.45.1, Python 3.12, same disk for both.</p>
<p>One thing about how the numbers were taken, because it matters here. The run was done twice. The first ran while another job was compiling a large C project on the same small machine, load average around 16, and its numbers are noisier. The second ran on a quiet box, load 0.30, and it is the primary result below. Both runs agree on every direction; only the absolute numbers move, and the random-read median flips between them, which is itself a finding.</p>
<h2>The table</h2>
<table>
<thead>
<tr>
<th>Operation</th>
<th align="right">SQLite (WAL)</th>
<th align="right">Plain files</th>
</tr>
</thead>
<tbody><tr>
<td>Write, bulk transaction</td>
<td align="right">19.30 MiB/s (6.90 s)</td>
<td align="right">41.12 MiB/s (3.24 s)</td>
</tr>
<tr>
<td>Write, one transaction per blob</td>
<td align="right">12.11 MiB/s (11.00 s)</td>
<td align="right">—</td>
</tr>
<tr>
<td>Sequential read, all 500</td>
<td align="right">94.59 MiB/s (1.41 s)</td>
<td align="right">20.25 MiB/s (6.58 s)</td>
</tr>
<tr>
<td>Random read, median (200 reads)</td>
<td align="right">0.137 ms</td>
<td align="right">0.317 ms</td>
</tr>
<tr>
<td>Random read, p99 (200 reads)</td>
<td align="right">121.58 ms</td>
<td align="right">74.95 ms</td>
</tr>
<tr>
<td>Disk used for 133.2 MiB of blobs</td>
<td align="right">267.2 MiB (see below)</td>
<td align="right">133.2 MiB</td>
</tr>
</tbody></table>
<h2>What the table says</h2>
<p>Writes belong to files, by about two times. Writing the corpus as plain files took 3.24 seconds. SQLite in one bulk transaction took 6.90 seconds, and one transaction per blob took 11.00 seconds, roughly 60 percent more than the bulk load. The gap is not a tuning artifact: every SQLite write pays for the journal, the page allocation, and the index maintenance, and the file write pays for almost none of it. If your workload is write-heavy, say an upload endpoint, the single-file convenience costs you a twofold slowdown on the operation you do most. That is the number people actually hit when they write a naive loader, one transaction per blob.</p>
<p>Sequential reads belong to SQLite, by a lot in the other direction. Reading all 500 blobs back in order took SQLite 1.41 seconds against 6.58 for files, 4.7 times faster. The database file is one large sequential read; the directory is 500 separate opens, each with its own lookup. If your workload is "read everything back in order", a backup restore, a migration, a full scan, SQLite wins clearly.</p>
<p>Random reads are a wash at the median, and I say that because the two runs disagree. On the quiet run the median is 0.137 ms for SQLite against 0.317 ms for files. On the loaded run it was the other way round, 0.242 against 0.167. Both are page-cache hits for small blobs, and the ordering is noise. The p99 numbers are the honest mess in the run: 122 ms for SQLite, 75 ms for files, on 200 reads. Both are far above the median, and the sample mixes blob sizes from 4 KiB to 1 MiB, so the p99 is dominated by the big blobs and should not be quoted as a single-blob number. I report it because it was measured, not because it decides anything. The median does not decide the random-read question either, and that is the point: at this size, with the data cached, there is no random-read winner to pick.</p>
<h2>The disk number, handled honestly</h2>
<p>The SQLite database file measured 280,178,688 bytes for 133.2 MiB of blobs. Twice the data. But that multiple is an artifact of the test, not of SQLite: the run also built a second table holding the same 500 blobs for the autocommit timing and then dropped it, leaving freed pages in the file. A vacuum would shrink it, and the steady-state size of the single table was not measured separately. Do not quote twice as SQLite overhead. The honest statement is narrower: the file you get from real use can carry dead space from tables you dropped, and if disk matters you should measure after a vacuum, not after a drop.</p>
<p>So the rule I am keeping is narrow, and it follows the workload. Write-heavy, or a tight disk: plain files. Sequential full reads, or a workload that wants transactions and one file to copy around: SQLite. Random single-blob reads: either, the difference at this size is noise. The thread's enthusiasm is for the second workload, and for that workload it is earned. For the first, the boring directory wins, and it wins by about two times on the write path.</p>
<p>The limit to state plainly: 500 blobs on one machine is a small setup, and the ratios belong to this size and this disk. A million blobs would change the file side. Directory lookups get slower as directories grow, and a larger database would amortise SQLite's fixed costs differently. What travels is the shape of the split, not the exact multiples: writes cost more in the database, sequential reads cost less, and the random-read difference is smaller than the noise in the machine.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[PHP 8.6 Hands-On: Partial Application, clamp(), and a Duration Type]]></title><description><![CDATA[PHP 8.6 went GA on November 19, with 27 accepted RFCs behind it. The release notes list the headline features: partial function application, default values…]]></description><link>https://aheadkit.hashnode.dev/php-8-6-hands-on-partial-application-clamp-and-a-duration-type</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/php-8-6-hands-on-partial-application-clamp-and-a-duration-type</guid><category><![CDATA[PHP]]></category><category><![CDATA[webdev]]></category><category><![CDATA[backend]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Fri, 20 Nov 2026 02:08:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/00ea2e25-253a-497b-97f1-b103bf885c37.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>PHP 8.6 went GA on November 19, with 27 accepted RFCs behind it. The release notes list the headline features: partial function application, default values for readonly properties, a Time\Duration type, a clamp() function, secure session defaults. And every write-up I read describes them the same way: quoted from the notes, never run. I wanted to run them. There is no PHP binary on this machine, and the package manager was not the route. It hung for nine minutes behind the proxy yesterday and was killed, so I built 8.6.0 from the release tarball and ran one small script per feature family against the build.</p>
<p>Six features ran. Six passed. One did not run at all, and the reason is worth stating before the results: this is a minimal build, configured with almost everything off, so it has no session extension, and the session-defaults claim in the notes stays unverified here. The rest below is measured, not quoted.</p>
<h2>The build</h2>
<p>The tarball is php-8.6.0.tar.gz from php.net, sha256 <code>62337dccde3d9fcc39797d4529f42637613036eaf3875353c206874e5813a3c1</code>. Configure: <code>--disable-all --enable-cli</code>, no libxml, no sqlite, no openssl, no zlib, no phar. Configure took about four minutes. The compile took about 35 minutes on a heavily loaded two-core machine, and it failed once at the link step: <code>/usr/bin/ld: final link failed: No space left on device</code>. The build tree lives in /tmp, and /tmp here is a 512M tmpfs; the tree was 332M. The fix was to move the tree to the home directory, symlink it back because the Makefiles bake in the absolute path, and resume. Second make exited 0. The binary reports <code>PHP 8.6.0 (cli) (built: Nov 20 2026 00:47:33) (NTS), Zend Engine v4.6.0</code>.</p>
<p>That disk-full failure is the most useful part of the build to know about, because it is the kind of failure that looks like a broken toolchain and is actually a full filesystem. If your own source build dies at link time with no space left, check /tmp first.</p>
<h2>The features, run</h2>
<p>Partial function application: <code>?</code> as a placeholder, <code>...</code> for the rest. A two-argument add, partially applied with 5, called with 3, returns 8. <code>str_repeat(?, 3)</code> called with <code>"ab"</code> returns <code>"ababab"</code>. Both pass. This is the feature I expected to be syntactic sugar with sharp edges, and on these two cases it is just what it says: a hole you fill later.</p>
<p>clamp(): <code>clamp(15, 0, 10)</code> is 10, <code>clamp(-5, 0, 10)</code> is 0, <code>clamp(5, 0, 10)</code> is 5. All three pass. It is a one-line function the language finally ships, and the only honest thing to say about it is that every codebase already has its own version of it, spelled slightly differently, and now there is one spelling.</p>
<p>Readonly property defaults: a class with <code>public readonly int $x = 3</code> and <code>$y = 4</code>, no constructor at all, reads back 3 and 4. Pass. Before 8.6, a readonly property with no default had to be assigned in the constructor; now the default lives on the declaration, which is where it belonged.</p>
<p>Time\Duration: <code>Duration::fromSeconds(90)</code> plus <code>fromSeconds(30)</code> is greater than <code>fromSeconds(90)</code> and equal to <code>fromSeconds(120)</code>. The dump shows seconds 120, nanoseconds 0, negative false. Pass. Nanosecond precision, a range of about 292 years. The comparison operators work on the values, not on object identity, which is the part that would have been easy to get wrong.</p>
<p>SortDirection: <code>SortDirection::Ascending-&gt;name</code> is <code>"Ascending"</code>. Pass. A small enum for sort direction, the kind of thing that replaces a boolean parameter nobody can read at the call site.</p>
<p>#[Override] on constants: a class implementing an interface that declares <code>VERSION = '1'</code>, with <code>#[Override] public const VERSION = '2'</code>, reads back <code>'2'</code>. Pass. The attribute on constants is new in 8.6; the check it performs is the same shape as the method version — a mismatch fails loudly instead of silently.</p>
<h2>The one that did not run</h2>
<p>The release notes promise secure session cookie defaults: strict mode on, httponly on, samesite Lax. I did not test them. This minimal build has no session extension, and no php.ini was loaded, so the three ini values read back empty. That is a property of my build, not of PHP 8.6, and I am not going to present the notes' claim as a measurement. The honest statement is: the defaults are claimed in the notes, unverified by this run, and the verification needs a build with the session extension in it.</p>
<p>So where does that leave 8.6? The six features I ran all do what the notes say, on the first try, with no surprises. That is the least exciting possible result, and it is also the result you want from a .0 release the day after it ships: the new syntax works, the new type compares correctly, and nothing I tested fell over. The build itself was the harder part, and the harder part was a full /tmp, not the compiler.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Compress Before You Buy RAM: zstd and lz4 on Real Files]]></title><description><![CDATA[The Hacker News post this week is short enough to quote in full: do not buy RAM, compress it. It landed with 232 points, and the idea is simple enough to…]]></description><link>https://aheadkit.hashnode.dev/compress-before-you-buy-ram-zstd-and-lz4-on-real-files</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/compress-before-you-buy-ram-zstd-and-lz4-on-real-files</guid><category><![CDATA[performance]]></category><category><![CDATA[Linux]]></category><category><![CDATA[Devops]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Fri, 20 Nov 2026 02:06:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/fd89aef9-8acc-4b53-97f6-64e5728116b5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Hacker News post this week is short enough to quote in full: do not buy RAM, compress it. It landed with 232 points, and the idea is simple enough to sound like a slogan: the memory you think you need to buy is mostly air, and a compressor will take it out for free. I wanted to know how true that is on real files, with real numbers, because a slogan is not a measurement. So I compressed 17.48 MiB of actual files on this machine, 2,059 of them, mostly documentation and C source, with zstd and lz4 at two levels each, and measured what each one saves, how fast it compresses, and how fast it gives the data back.</p>
<p>The headline holds, with one trap in it. At the sensible level, zstd takes 17.48 MiB down to 3.41 MiB: a 5.13x ratio, 14.07 MiB saved, 80 percent of the memory gone, compressed at 46.8 MiB/s. That is the buy-less-RAM number, and it is real. The trap is the top level. zstd at level 19 squeezes out one more megabyte and takes 61 seconds to do it. The saving is real. The price is absurd. The post is right. The level is the whole question.</p>
<h2>The corpus</h2>
<p>The files are real, not generated: 2,059 files totalling 17.48 MiB, 11.41 MiB of Markdown, 5.51 MiB of C source, 0.43 MiB of headers, 0.12 MiB of logs. Text-heavy, which is the kind of data that compresses well and the kind that actually sits in memory on a developer machine: docs, source, logs. Binary data would compress worse, and I say that plainly because the ratio below belongs to this corpus, not to all data. There are no system zstd or lz4 binaries on this machine, so the measurements use the Python bindings for both, in an isolated environment, three runs each, median reported.</p>
<h2>The table</h2>
<table>
<thead>
<tr>
<th>Algorithm</th>
<th align="right">Compressed</th>
<th align="right">Ratio</th>
<th align="right">Saved</th>
<th align="right">Compress</th>
<th align="right">Decompress</th>
<th align="right">Decompress latency</th>
</tr>
</thead>
<tbody><tr>
<td>zstd -3</td>
<td align="right">3.41 MiB</td>
<td align="right">5.13x</td>
<td align="right">14.07 MiB</td>
<td align="right">46.8 MiB/s</td>
<td align="right">159.3 MiB/s</td>
<td align="right">109.7 ms</td>
</tr>
<tr>
<td>zstd -19</td>
<td align="right">2.32 MiB</td>
<td align="right">7.52x</td>
<td align="right">15.16 MiB</td>
<td align="right">0.3 MiB/s</td>
<td align="right">972.3 MiB/s</td>
<td align="right">18.0 ms</td>
</tr>
<tr>
<td>lz4 level 0</td>
<td align="right">6.84 MiB</td>
<td align="right">2.56x</td>
<td align="right">10.64 MiB</td>
<td align="right">59.6 MiB/s</td>
<td align="right">270.6 MiB/s</td>
<td align="right">64.6 ms</td>
</tr>
<tr>
<td>lz4 level 9</td>
<td align="right">4.95 MiB</td>
<td align="right">3.53x</td>
<td align="right">12.53 MiB</td>
<td align="right">3.7 MiB/s</td>
<td align="right">200.6 MiB/s</td>
<td align="right">87.1 ms</td>
</tr>
</tbody></table>
<h2>What the table says</h2>
<p>First, the cheap win is real and it is zstd at level 3. It keeps 19.49 percent of the original size, throws away 80 percent of the memory, and compresses the whole corpus in 0.37 seconds. If the claim is "compress before you buy RAM", this is the number that carries it: four-fifths of the memory gone, at a speed where the compression itself is barely noticeable.</p>
<p>Second, lz4 is faster and weaker, exactly as advertised. Level 0 compresses at 59.6 MiB/s, the fastest here, but keeps 39.12 percent of the original. It saves 10.64 MiB where zstd -3 saves 14.07. Level 9 closes some of the gap, 3.53x, but its compress speed falls to 3.7 MiB/s, a sixteen-fold slowdown for one extra megabyte saved. lz4 is the right call when compress speed is the constraint and the data is short-lived. It is the wrong call when the data sits in memory for a while and the ratio is what you pay for.</p>
<p>Third, and this is the trap: zstd -19. It saves 15.16 MiB against -3's 14.07, one megabyte more, 6 percent more saving, and it takes 61.4 seconds to compress the corpus against 0.37 seconds. That is 165 times slower for 6 percent more. The decompression side is the twist: -19 decompresses fastest of all, 972.3 MiB/s, because the denser stream has less to read back. (The per-run latency figures bounced around with machine load, so I am not leaning on the 18 ms number itself.) So -19 is not useless. It is a write-once, read-many shape: pay the minute once, read it back faster forever. But as a general answer to "my machine needs more RAM", it is the wrong level. Nobody's working set is worth a minute of compression per 17 MiB.</p>
<h2>The limit of the claim</h2>
<p>The honest limit is the corpus. Text compresses well. A machine whose memory is full of already-compressed images, video frames, or encrypted buffers will not see a 5x ratio, and for that machine the post's advice does not hold. Compression also costs CPU on every access, and the decompression work is the price of the saving, paid on every read that misses. On this corpus, at zstd -3, the trade is a clear win: 14 MiB saved for a third of a second of compression. On a different corpus, measure first. The post is a slogan. The level is the measurement.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[The nginx Reload That Reports Success and Changes Nothing]]></title><description><![CDATA[OneLifeVibe left a comment on my nginx write-up yesterday, and it named the check I had skipped. I had applied the stopgap, http2 off; on a local 1.28.0…]]></description><link>https://aheadkit.hashnode.dev/the-nginx-reload-that-reports-success-and-changes-nothing</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/the-nginx-reload-that-reports-success-and-changes-nothing</guid><category><![CDATA[nginx]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Security]]></category><category><![CDATA[Linux]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Fri, 20 Nov 2026 02:01:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/22580ee7-755c-4b47-8d7a-dd835b078a37.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>OneLifeVibe left a comment on my nginx write-up yesterday, and it named the check I had skipped. I had applied the stopgap, <code>http2 off;</code> on a local 1.28.0 build, reloaded, and confirmed the negotiated protocol on a test request. One request, one answer, mitigation complete. OneLifeVibe asked for the two things that would actually make that claim hold: confirm the old workers have exited, and log the protocol for a sample of real requests, not just a single test request.</p>
<p>So I ran it again, properly this time. Same local 1.28.0 build, same TLS test site, but a sample of requests across the static and proxy locations, a worker PID check after every reload, and a deliberate reproduction of the trap my first run tripped over: reloading against a different config file than the one the running server started with. The reload reports no error. The server keeps serving HTTP/2. That part is not new. What is new is the count: the trap survives a twelve-request sample, not just a single test, and the stopgap survives a twenty-four-request sample the other way.</p>
<h2>The setup</h2>
<p>The build is nginx 1.28.0, compiled from the nginx.org tarball with the HTTP/2 and TLS modules, serving a static location and a <code>/api/</code> proxy location over TLS on loopback. 1.28.0 sits inside both vulnerable ranges for the two CVEs in this week's advisory, and HTTP/2 is on. The backend for the proxy location is a plain local file server. Nothing here is a production box, and the numbers below are loopback numbers, but the reload behaviour is the server's own, not the network's.</p>
<p>The stopgap is the advisory's: <code>http2 off;</code> in the server block. The trap is the one my first run found by accident. <code>nginx -s reload</code> ignores a <code>-c</code> flag. The master re-reads the file it started with. Edit a different file, reload against it, and the reload exits 0 while nothing changes.</p>
<h2>The trap still bites, twelve requests out of twelve</h2>
<p>Before any reload, 24 requests, 12 against <code>/</code> and 12 against <code>/api/</code>, all negotiated HTTP/2. Then the trap: I edited a decoy config file with <code>http2 off;</code> and ran the reload against it. Exit code 0. No error anywhere. The old worker exited cleanly, a new worker started, and the new worker re-read the live config, HTTP/2 on, not the decoy file. Another 12 requests, 6 per location: all 12 still HTTP/2.</p>
<p>That is the trap in its full shape. The reload did run. A worker did exit and a new one did start. Everything observable says the reload happened, except the one thing that matters: the protocol did not change. A single test request would have shown the same thing here, and I will come back to that, but the sample is what makes the claim checkable. Twelve requests across two locations, all still on HTTP/2, is not a flaky read. It is a server that never got the message.</p>
<h2>The stopgap, done right: twenty-four requests, zero on HTTP/2</h2>
<p>Then the real reload. I copied the HTTP/2-off config into the live file, the file the running master actually reads, and reloaded. 24 requests, 12 per location: all 24 negotiated HTTP/1.1, zero on HTTP/2. An ALPN spot check agreed: the server accepted HTTP/1.1. An explicit HTTP/1.1 request returned 200 with protocol 1.1. The site keeps serving; only the protocol changes.</p>
<p>The worker check is the part OneLifeVibe asked for, and it held. The original worker, PID 7233, is gone. No such process. The trap-reload worker, 7383, exited with code 0 per the error log. The new worker, 7483, took over. No nginx processes were left after the stop. A reload that reports no error can still leave the old behaviour in place, and the only way to know is to check the PIDs and the protocol, not the exit code.</p>
<h2>The honest limit: one request would have given the same answer here</h2>
<p>I should say plainly where the sample did not change anything. In this run, every request agreed: 24 out of 24 before, 12 out of 12 after the trap, 24 out of 24 after the stopgap. A single test request would have returned the same answer in all three cases. The sample did not catch a straggler old worker serving HTTP/2 on some connections, because there was no straggler to catch.</p>
<p>That does not make the sample pointless. It makes it the only thing that could have caught one. A reload is a handoff between an old worker and a new one, and a single request only proves the connection it landed on. If an old worker is still draining a long-lived connection somewhere, one request will not find it. Twenty-four requests across two locations might. The sample is cheap, a few seconds of requests, and the failure it guards against is a mitigation you believe in that is not actually in place. The trap itself is invisible to a single request too: the reload exits 0 either way, and the exit code is the one thing a single check usually trusts.</p>
<p>So the rule I am keeping is the one OneLifeVibe wrote: a reload is not complete until the old workers are gone and a sample of real requests agrees on the protocol. The exit code is not evidence. The PIDs are. The sample is.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Microsoft's MAI Code 2 Claim, Checked Against Its Own Ignite Pages]]></title><description><![CDATA[Microsoft's Ignite announcement says its new coding model, MAI Code 2, gives you 98% of the performance of GPT-6.1 Sol at 40% of the cost, and 96% of…]]></description><link>https://aheadkit.hashnode.dev/microsoft-s-mai-code-2-claim-checked-against-its-own-ignite-pages</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/microsoft-s-mai-code-2-claim-checked-against-its-own-ignite-pages</guid><category><![CDATA[AI]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[llm]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Thu, 19 Nov 2026 02:14:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/64d36c48-4fbf-4f6b-b6f5-98831b16c4f8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Microsoft's Ignite announcement says its new coding model, MAI Code 2, gives you 98% of the performance of GPT-6.1 Sol at 40% of the cost, and 96% of Claude Opus 5.5's performance at 5% of the cost. That sentence travelled everywhere within a day. I checked it against Microsoft's own Ignite pages, because a claim this neat deserves to be read where it was made, including the parts around it that did not travel with it.</p>
<p>The claim checks out as a quote. Microsoft's own pages say exactly that, in the same words, in three places: the announcement of the seven new models, the keynote transcript, and the detail page for Code 2 itself. Averaged over four benchmarks, DeepSWE 1.1, Terminal-Bench 2.1, SWE-Atlas and FrontierCode v1.1, MAI Code 2 gives 98% of GPT-6.1 Sol's performance at 40% of the price, and 96% of Claude Opus 5.5's at 5%. The smaller Code 2 Flash is rated comparable to GPT-6 Luna at 65% of the price and to Claude Haiku 5.5 at 20%, across three of those benchmarks. If you repeat the headline, you are repeating Microsoft accurately.</p>
<p>The scope around the claim is stated just as plainly, and it narrows the claim a lot. All three pages say the models are built for the everyday enterprise coding work Microsoft sees in GitHub Copilot, and that they are explicitly not yet tuned for harder problems, like fundamental science research and very long horizon agentic work. So the 98% covers routine coding: taking code to production, deep debugging, changes across many files, reasoning across a repository. It does not cover the hardest work, and Microsoft says so itself. There is also a smaller human result on the detail page: in blind side-by-side tests of frontend work, developers preferred MAI Code 2's results over GPT-6 Sol 64% of the time.</p>
<p>That is what the pages support. Here is what they do not support, and the gap matters more than the headline.</p>
<p>First, there are no raw scores. None of the three pages publishes a table of the four benchmark results per model. All you get is the averaged percentage: 98%, 96%. You cannot see which benchmark carried the average and which one dragged it, or how close any single benchmark was. An average without its parts is a claim you have to take on trust.</p>
<p>Second, the price basis sits in a footnote I could not read. The detail page marks the 98% and 40% sentence with a footnote, and the Flash sentence with another, but the footnote text is not printed on the page. I looked for it twice. So from Microsoft's pages as I read them, I cannot confirm what "40% of the cost" is priced at: list price, a promotional price, or the cost of running one benchmark task. Those are three different numbers, and the headline does not say which one it is. The same goes for the method: which setup ran the benchmarks, at what effort, and who ran which one. The pages name the benchmarks and stop there.</p>
<p>Third, everything here is Microsoft measuring its own model. The benchmarks were chosen by Microsoft, the tests were run by Microsoft, and no outside test of MAI Code 2 against GPT-6.1 Sol or Opus 5.5 is cited on any of the three pages. That does not make the numbers wrong. It makes them a vendor claim, not a measured fact, and vendor claims about a vendor's own model are the ones that most need an outside check before you budget on them.</p>
<p>Fourth, the comparison names GPT-6.1 Sol, and Microsoft's pages say nothing about any newer OpenAI model. The pages alone cannot tell you whether 6.1 Sol is still the model to beat, or whether the comparison would look the same against the model OpenAI ships today.</p>
<p>I also checked the shape of the launch, because the headline can make it sound like one model. It is seven: MAI Cyber 2 Flash, MAI Code 2, MAI Code 2 Flash, MAI Image 2.7, MAI Realtime 1, Dragon Copilot Transcribe, and Decision 1.1, plus the Maia 200 chip. The coding models are available in GitHub Copilot now, Code 2 on the paid plans and Flash on the free and student plans too, with Flash also in a limited preview in Microsoft Foundry. The security model carries its own version of the same pitch: ahead of GPT-6 Astra on CyberGym-E2E at less than 2% of the cost per task.</p>
<p>So the honest verdict is narrower than the headline and more useful than a dismissal. The 98% at 40% claim is real in the sense that Microsoft's own pages say it, word for word, and scope it honestly to everyday enterprise coding. But it is an average over four vendor-chosen benchmarks with no published raw scores, measured by the vendor, with the price basis sitting in a footnote I could not read on the pages themselves. Treat it as a launch claim with a stated scope. Before you plan spending around "40% of the cost", read the footnote on the detail page and find out what that 40% is priced at. That one line decides whether the headline is a saving or a promotion.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Unauthenticated Remote Code Execution in Nginx: Checking a Local Build]]></title><description><![CDATA[Two flaws in Nginx, both rated Critical at 9.2 under CVSS 4.0, both letting an attacker run code on the server without logging in, both needing HTTP/2…]]></description><link>https://aheadkit.hashnode.dev/unauthenticated-remote-code-execution-in-nginx-checking-a-local-build</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/unauthenticated-remote-code-execution-in-nginx-checking-a-local-build</guid><category><![CDATA[nginx]]></category><category><![CDATA[Security]]></category><category><![CDATA[webdev]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Thu, 19 Nov 2026 02:09:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/8159e653-2698-4197-82fd-e5000c227d46.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Two flaws in Nginx, both rated Critical at 9.2 under CVSS 4.0, both letting an attacker run code on the server without logging in, both needing HTTP/2 switched on. That is the headline from the write-up Wiz published on 18 November 2026, and it is the kind of headline that makes everyone check their version number at once. I checked mine by building Nginx from the published source and running it, because a version number on a page is not the same as a version running on a machine.</p>
<p>The two flaws are CVE-2026-123633 and CVE-2026-123007. The first is a use-after-free in how Nginx handles HTTP/2 connections. A connection with no active requests gets marked reusable, and when a request starts on it, Nginx forgets to take it off the reusable list. When free connection slots run low, Nginx can close that connection while its own request is still running, freeing memory the request still uses. It affects versions 1.19.7 to 1.31.8, and it needs Nginx running as a proxy. The second is an integer underflow in HTTP/2 flow control. When a stream is cancelled, Nginx returns the allowance for unsent data without checking the maximum window, the counter passes the maximum, a later check underflows, and a negative length reaches the code that sends data over TLS as a copy outside the buffer. It affects versions 1.9.5 to 1.31.8, back to 2015, and Wiz demonstrated code execution with it on Nginx serving ordinary static files, no backend, no extra modules. Both were reported to F5 by five teams working independently, and both were fixed on 18 November in Nginx open source 1.30.7 for the stable branch and 1.31.9 for mainline. Wiz built working exploits for both and chose not to release them. I did not try to build one.</p>
<p>My machine had no Nginx installed, so I built two versions from the published source: 1.28.0, which sits inside both affected ranges, and 1.30.7, the fixed stable release. Both were built with TLS and HTTP/2 support. The test site served static files over HTTPS with HTTP/2 on, plus a proxy location pointing at a small local backend, so both flaws had the configuration they need.</p>
<p>The 1.28.0 build served HTTP/2 exactly as the write-up describes. A request for the front page came back 200 over HTTP/2, and so did a request through the proxy location. The negotiated protocol was HTTP/2 in both cases. By version and by configuration, that build is affected: it is inside both ranges, HTTP/2 is on, and it serves both static files and proxied traffic.</p>
<p>The fixed build behaved the same way on the wire. 1.30.7 served the front page 200 over HTTP/2. The fix is in the code, not in the feature: HTTP/2 still works, the memory errors behind it are gone.</p>
<p>The part I wanted to verify most carefully was the stopgap, because that is what people actually do while a patch waits for a maintenance window. Wiz says: if you cannot upgrade right away, switch HTTP/2 off, reload, confirm the old workers have exited, and switch it back on after upgrading. I did exactly that on the 1.28.0 build. Before the change, requests came back over HTTP/2. After editing the live configuration to switch HTTP/2 off and reloading, the same requests came back over HTTP/1.1, and the server confirmed it in the handshake. The site kept serving through the whole change. The old worker exited cleanly and a new one took over. The stopgap works, on this build, as written.</p>
<p>One trap is worth writing down, because I fell into it. My first attempt at the reload pointed the reload at a different configuration file than the one the running server had started with. The reload went through, reported nothing wrong, and HTTP/2 stayed on. A reload reads the file the running server started with; pointing it elsewhere changes nothing. If you apply this mitigation and do not check the protocol afterwards, you can walk away believing you are safe while HTTP/2 is still serving. Check the protocol after the reload, not just the reload itself.</p>
<p>The same release that fixes these two also fixes eight more flaws Wiz lists, including a use-after-free in HTTP/3 proxying, one in the DNS resolver and one in the mail proxy, plus a denial of service in TLS 1.3 request handling. The two critical ones are the reason to move, but the release is bigger than two fixes.</p>
<p>So the practical answer is short. If your Nginx is between 1.9.5 and 1.31.8 with HTTP/2 on, patch to 1.30.7 or 1.31.9. If patching has to wait, switch HTTP/2 off, reload, and confirm on the wire that requests are coming back over HTTP/1.1. And do not treat a version number you have not checked as an answer either way: I ran the vulnerable version and the fixed version side by side, and from the outside they serve pages identically. The only difference is the version string, and the only reliable fix is the patch.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[FastAPI 0.163's Dependency Concurrency Limit Deadlocked Two Routes]]></title><description><![CDATA[FastAPI 0.163.0 shipped on 14 November 2026 with a single feature: Depends(dependency, max_concurrency=N), a cap on how many calls to one dependency can…]]></description><link>https://aheadkit.hashnode.dev/fastapi-0-163-s-dependency-concurrency-limit-deadlocked-two-routes</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/fastapi-0-163-s-dependency-concurrency-limit-deadlocked-two-routes</guid><category><![CDATA[FastAPI]]></category><category><![CDATA[Python]]></category><category><![CDATA[webdev]]></category><category><![CDATA[backend]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Thu, 19 Nov 2026 02:07:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/015708d5-a110-42f6-bfb3-bafbdd693399.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>FastAPI 0.163.0 shipped on 14 November 2026 with a single feature: <code>Depends(dependency, max_concurrency=N)</code>, a cap on how many calls to one dependency can run at the same time. It sounds like a small, safe addition. alexgeorgiev17 tried to break it the day it reached PyPI, and he found the break: two routes, each holding one capped resource and waiting for the other, hang forever. He is the finder here, and his post is the source for the shape of the test. I rebuilt his deadlock from his description and ran it myself, because a concurrency limit that can hang your server deserves a second pair of hands on it.</p>
<p>The feature itself works as described. <code>max_concurrency</code> wraps a dependency in a semaphore. Call the dependency more times at once than the limit allows and the extra calls wait. If the dependency uses <code>yield</code>, it holds its slot for the lifetime of the request, not just while the function runs. That last detail is the one that matters, because a slot held for a whole request can be held while the request waits for something else.</p>
<p>My test app has two yield dependencies, A and B, each doing 0.2 seconds of setup work and each capped at one concurrent user. One route takes A then B. The other takes B then A. That is the whole setup, and it is the shape that kills you: two routes needing the same two capped resources in opposite orders.</p>
<p>First the controls, so the deadlock means something. One request at a time, each route answers in 0.59 seconds with both values. The routes are fine. The dependencies are fine. Nothing is slow.</p>
<p>Then both routes at the same moment. Neither came back. I gave each request 6 seconds and both were still waiting when the time ran out, with empty responses. That matches what alexgeorgiev17 saw: he let his pair run for eight seconds against a timeout and it never resolved, and his check over a real socket ended the same way, both requests killed by the timeout. There is no deadlock detection inside the feature, so in production this is two hung requests that sit there until something outside the app kills the connection.</p>
<p>The fix is unglamorous, which is why it is easy to skip. Take both resources in the same order on every route. I added a second pair of routes that both take A then B, and fired them together: both answered, in 0.83 and 0.47 seconds. Same dependencies, same caps, same load. The only change is the order, and the deadlock is gone. If a route needs two capped resources, write the order down once and use it everywhere. That is the whole fix.</p>
<p>I also checked the cap itself, because a limit that does not limit would be a different kind of bug. Twenty requests at once against one dependency with a 0.2 second cost and a gate of five took 1,214, 1,183 and 1,106 milliseconds across three runs. That is roughly four waves of 0.2 seconds through a gate of five, plus the load on this machine. alexgeorgiev17 measured 0.82 to 0.84 seconds for the same shape on his machine. Mine runs slower because the machine I ran it on was busy, but the shape is the same: the gate queues the work instead of letting all twenty through at once. The cap does what it says.</p>
<p>Two things I noticed while running this are worth more than the deadlock itself. First, the deadlocked requests outlive the client that made them. After my first deadlock test, the two requests stayed stuck on the server holding A and B, so a later test of the fixed routes on the same server timed out too. The server had to be restarted before the fixed routes would answer. In production, two hung requests also poison the gate for everyone behind them until the worker is recycled.</p>
<p>Second, the poisoned server would not stop cleanly. A normal stop signal left the old server process alive, because a graceful stop waits for requests in flight, and these two never finish. It took a forced kill. A deadlock that also blocks your deploys is a worse bug than a deadlock that only hangs two requests.</p>
<p>None of this makes <code>max_concurrency</code> a bad feature. A cap on a shared resource is genuinely useful, and the failure mode here is the classic one: two locks taken in opposite orders. But it does mean the feature has a sharp edge that the docs do not spell out loudly enough. Before adding it to anything touching a real connection pool, go through every route that uses the capped dependency and check the order each one takes its resources in. Two routes taking the same two resources in opposite orders is a deadlock waiting for two requests to land close enough together, and from the outside it looks like the server hung for no reason.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Solid 2.0 on a Bigger App: Does the Bundle Gap Shrink?]]></title><description><![CDATA[Alex Yu asked the question in the comments under my last Solid piece, and it was the right one to ask. The small app I built for Solid 2.0 shipped 59.84 kB…]]></description><link>https://aheadkit.hashnode.dev/solid-2-0-on-a-bigger-app-does-the-bundle-gap-shrink</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/solid-2-0-on-a-bigger-app-does-the-bundle-gap-shrink</guid><category><![CDATA[solidjs]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[webdev]]></category><category><![CDATA[frontend]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Thu, 19 Nov 2026 02:04:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/c7cef61d-1b69-49e2-97d1-37e611ed9b1a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Alex Yu asked the question in the comments under my last Solid piece, and it was the right one to ask. The small app I built for Solid 2.0 shipped 59.84 kB of JavaScript against 15.06 kB on Solid 1.9.19, production build, tree-shaken. Four times the code for the same counter and list. But was most of that the new reactive core, and does the gap shrink when the app gets bigger and the framework cost becomes a smaller share of the total? I built the bigger app to find out.</p>
<p>The app is a five-page catalogue demo with routing: a home page with a counter and a short delayed list load, a 48-item catalogue with search, a category filter and sorting by name, price or rating, a product page for each item, an about page and a settings form, plus a 404 page. The same app on both versions, the same 48 seeded items, the same pages. Only the framework version changes.</p>
<p>The numbers first. Solid 1.9.19 with its router ships 40.49 kB, gzip 15.38 kB. Solid 2.0.0 with its router ships 70.29 kB, gzip 27.70 kB. Against the small app, the gap was 44.78 kB, a ratio of 3.97 to 1. On the bigger app the gap is 29.81 kB, a ratio of 1.74 to 1. So yes, the gap shrinks, both in absolute terms and as a ratio. Alex Yu's hunch was right.</p>
<p>The more interesting number is how each version grew. The 1.9.19 app grew from 15.06 kB to 40.49 kB when the app got bigger, an extra 25.43 kB of pages and routing. The 2.0.0 app grew from 59.84 kB to 70.29 kB, an extra 10.45 kB. The bigger app cost the 2.0 build less than half what it cost the 1.9 build, because the 2.0 bundle was already paying for machinery the bigger app uses. That is the whole story in one comparison: 2.0 charges you up front, then the marginal page is cheap.</p>
<p>I pulled both bundles apart with a bundle analyzer to see which piece costs what. The sizes below are pre-minify module sizes, so read them as shares, not as bytes that add up to the totals above.</p>
<p>On 1.9.19, the router costs more than the framework. The router is 44.0% of the bundle and Solid itself is 41.6%. The app code is 12.9%. The single biggest file is the Solid core at 21,332 bytes, then the web renderer at 17,416, then the router's routing file at 13,981.</p>
<p>On 2.0.0, one package is most of the bundle. <code>@solidjs/signals</code>, the new reactive core, is 59.4% of the whole thing. Its two biggest files alone, the scheduler at 42,799 bytes and the core at 38,623, are larger than the entire 1.9.19 app code twice over. The router is 29.0%, the web renderer 6.5%, the app code 4.1%. And <code>solid-js</code> itself is 0.7%: in 2.0 it is a thin layer over the signals package and the web package. So to Alex Yu's first question, is most of it the new reactive core: yes, clearly. Three fifths of the bundle is the signals package, and the router is the second cost, not the first.</p>
<p>The router deserves a closer look because it changed shape between versions. On 1.9.19 the router's biggest file is its routing code. On 2.0.0 the router's biggest file is still routing, at 26,303 bytes, but the second biggest is its data file at 19,762 bytes, the code behind the query and form-action features. My app never calls those features. They ride along anyway. That is 19,762 bytes of pre-minify code for a feature the app does not use, inside a router that is itself a third of the bundle.</p>
<p>Building the bigger app also forced two migrations the small app never touched. The router in 2.0 is a rewrite, not a bump. There is no Router component, no Route component and no link component. Routes are plain config objects handed to a function, links are ordinary anchors, and route parameters come from a hook. I had to rewrite the app shell for 2.0, not just change a version number. And on 1.9.19, the shared nav taught me something too: every direct child of the old Router is treated as a route definition, so a nav placed there as a plain child breaks the link component, which throws because it has no router context. The nav has to live in a root layout. The small app had no nav, so this never surfaced.</p>
<p>Both apps render all five routes, which I checked by loading each built page and reading what it produced: home, the 48-item list with its $3,733.54 total, product 7 ("Silent lamp 7", $79.96), settings, and the 404 page. One test note: the 2.0 router reads a timing value on startup that the test page I used does not provide, so the check needed that value filled in first. Real pages provide it. The app itself was not changed for the check.</p>
<p>So where does that leave the 2.0 bundle question? The 4x figure from the small app was real but it was the worst case: a tiny app where the framework is nearly everything. On a five-page app with routing, the gap is 1.74x and 29.81 kB. That is still a real cost, and it is still mostly the new reactive core, but it stops looking like a cliff and starts looking like a fixed charge. If your app is one counter on a page, 2.0 is a heavy choice. If your app is five pages with routing, lists and forms, the extra cost buys you a router and a data layer you may or may not use, and the pages themselves stay cheap. The honest version of the 2.0 story is not "four times the JavaScript". It is "about 30 kB more on a real app, most of it a new reactive core, and the next page costs less".</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Solid 2.0 Hands-On: The Same Small App Ships Four Times the JavaScript.]]></title><description><![CDATA[Solid 2.0 is here after five years, and its announcement reads like a framework growing up: async inside the reactive graph, server functions in the core…]]></description><link>https://aheadkit.hashnode.dev/solid-2-0-hands-on-the-same-small-app-ships-four-times-the-javascript</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/solid-2-0-hands-on-the-same-small-app-ships-four-times-the-javascript</guid><category><![CDATA[solidjs]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[webdev]]></category><category><![CDATA[frontend]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Wed, 18 Nov 2026 01:38:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/5a93f531-81f7-4c94-901e-d90680fb3145.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Solid 2.0 is here after five years, and its announcement reads like a framework growing up: async inside the reactive graph, server functions in the core, diagnostics that catch your mistakes as you make them, and seven old primitives deleted because the new model no longer needs them. It is a big story. So I built the same small app twice — once on Solid 1.9.19, once on Solid 2.0.0, and measured what the upgrade actually does to a real project. The headline number surprised me, and not in the way I expected.</p>
<p>The app is deliberately ordinary: a counter, a button, and a list of five items that arrive after a short wait. The 1.x version loads the list with <code>createResource</code> inside a <code>Suspense</code> boundary, the way Solid developers have written it for years. The 2.0 version follows the announcement's own example: an async <code>createMemo</code>, a <code>Loading</code> boundary, and <code>isPending</code> to say whether the list has arrived yet. Same five items, same counter, same button. Nineteen lines in one, eighteen in the other. The new version is not shorter here, and not longer either. The difference is underneath.</p>
<p>The first thing the upgrade did was break my build, twice, and both breaks are things the announcement does not warn you about. The stable Vite plugin, version 2.11.16, refuses Solid 2.0 outright: its peer requirement is Solid 1.7.2 and up, and it will not install alongside 2.0.0 without forcing it. The plugin that does support 2.0 is a prerelease, 3.0.0-next.27. Then the build failed again, because <code>solid-js/web</code> no longer exists: rendering has moved out into a separate package, <code>@solidjs/web</code>, which you now install on its own. Two changes, both mechanical, both undiscoverable from the announcement alone. If you upgrade on a Friday afternoon, budget an hour for these two.</p>
<p>Once it built, I ran the production build three times on each version. The 1.9.19 app built in 1.01 to 1.27 seconds. The 2.0.0 app built in 2.16 to 2.46 seconds, roughly twice as slow on this machine, though on a build this small the absolute numbers are barely worth arguing about. The number that is worth arguing about is the bundle. The 1.9.19 app shipped 15.06 kB of JavaScript, 6.32 kB after compression. The 2.0.0 app shipped 59.84 kB, 23.78 kB compressed. The same app, the same five list items, nearly four times the JavaScript.</p>
<p>I checked that both apps actually work before writing that sentence, because a bundle comparison is meaningless if one of them is broken. I loaded each built bundle in a page and read what it rendered: both showed "Counter 0", the button, and all five items — alpha, bravo, charlie, delta, echo. The 2.0 version additionally showed "loaded" from its <code>isPending</code> check, which is the new machinery doing its job. Both apps are correct. One of them just carries four times the code to be correct.</p>
<p>Why is the new bundle so much bigger? I did not take the bundle apart line by line, so I will not pretend to know exactly which piece costs what. But the shape of the answer is visible in the dependency list: 2.0 splits the framework into more packages (a separate signals package, a separate web package, serialisation libraries that 1.x did not ship), and the new features, server functions and diagnostics and the async graph, are in the bundle whether this little app uses them or not. A counter and a list do not use server functions. They still pay for them.</p>
<p>That is the honest tension in this release, and it is the opposite of the story the announcement tells. The announcement's story is that 2.0 collapses the surface area: fewer primitives to learn, less ceremony around async, less code to maintain. All of that is true about the code you write. It is not true about the code you ship. On my measurement, the code you ship got nearly four times bigger, and the code you write stayed the same length. The framework got simpler to think about and heavier to download, at the same time.</p>
<p>Should you upgrade? If you are starting something new, yes. The async model is genuinely nicer, the diagnostics are the kind of thing that saves an afternoon, and building on the version with a future beats building on the one without. If you have a 1.x app in production, there is no urgency in these numbers: nothing I measured says your app gets faster or smaller by moving, and the upgrade will cost you an afternoon of plugin and import fixes before it costs you anything else. And if bundle size is the number your users feel (a slow connection, a cheap phone), then measure your own app before you move, because my little counter says the new version ships heavier, and your app deserves its own measurement rather than my surprise.</p>
<p>The deeper point is the one the announcement makes almost in passing: Solid 2.0 retires its own metaframework, because every primitive needed to build one now lives in the core. That is a framework betting its future on being a set of primitives other people build on. It is a good bet. But the first thing a set of primitives should be is small, and on the evidence of one small app, Solid 2.0 is not small yet. The ideas are right. The bundle has some catching up to do.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[ONNX Runtime Disappeared From GitHub. The Packages Still Install.]]></title><description><![CDATA[ONNX Runtime has disappeared from GitHub. Not archived, not renamed, not moved. Gone. The address github.com/microsoft/onnxruntime returns a 404, and so…]]></description><link>https://aheadkit.hashnode.dev/onnx-runtime-disappeared-from-github-the-packages-still-install</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/onnx-runtime-disappeared-from-github-the-packages-still-install</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[Python]]></category><category><![CDATA[open source]]></category><category><![CDATA[GitHub]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Wed, 18 Nov 2026 01:35:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/286e11eb-34c6-402a-924b-d3c16400b81d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>ONNX Runtime has disappeared from GitHub. Not archived, not renamed, not moved. Gone. The address <code>github.com/microsoft/onnxruntime</code> returns a 404, and so does the address for its companion repositories. I checked at 00:04 UTC on 18 November 2026, and again at 00:18. Both times the same answer: not found.</p>
<p>The repository was not a small one. Nine days ago it showed 22,267 stars, 4,428 forks, 16,124 commits and 90 releases, going back to November 2018. It is the home of the inference engine behind a large share of the machine-learning models running in production: inside Office, Bing and Visual Studio, according to Microsoft's own pages, and inside thousands of other projects that list it as a dependency. The thread that surfaced the disappearance, posted on Hacker News at 23:18 UTC on 17 November by a user whose team's evaluation pipelines had started failing that morning, now sits at 41 points with two comments and no answer. "Does anyone know why or how a repository with 22k stars just went dark?" Nobody there knew.</p>
<p>The first thing to check with a disappearance like this is whether the whole neighbourhood went with it. It did not. Microsoft's other large repositories — VS Code, TypeScript, the Windows Terminal — all answer normally. GitHub's own status page says all systems are operational. This is not an outage, and it is not GitHub having a bad night. It is specific to the ONNX Runtime family: the main repository, the generative-AI repository, the inference-examples repository and the training-examples repository all return 404. Four repositories, one project, gone together.</p>
<p>The second thing to check is what still works, because a repository is not the whole project. The project's own site, onnxruntime.ai, loads fine, and its documentation pages answer normally. The Python package is still there: version 1.32.0 is the latest on PyPI, and I downloaded the wheel, 27.8 MB, straight from the package index, no trouble. The .NET package is still there too, with 1.32.0 the latest on NuGet. If your build installs ONNX Runtime from a package index, as most builds do, nothing broke this morning. Your next install will work exactly like your last one.</p>
<p>So what actually happened? Honestly, nobody outside Microsoft knows yet, and the two comments on the Hacker News thread are guessing: one suggests a supply-chain attack, another jokes that Microsoft is taking a lesson from OpenAI about what "open" means. Neither is evidence. The shapes a disappearance like this can take are limited, and it is worth naming them plainly. A repository can be deleted deliberately, made private, removed by GitHub for a policy or legal reason, or taken down by its owner after a security incident. A rename would have left a redirect, not a 404. A move to another organisation would have left a trace in the search results. None of those traces exist. Four related repositories vanishing at once, with no announcement and no redirect, looks like a deliberate act by someone with access. Deliberate by whom, and for what reason, is not something the public evidence answers.</p>
<p>Here is what that means for you, in order of how much it should worry you. If you install ONNX Runtime from PyPI or NuGet, keep going. Those channels are untouched, and 1.32.0 is there today. If your build clones the repository, it is already failing, and it will keep failing until Microsoft says something or the repository comes back. If you contribute to the project, or you have open pull requests or issues there, they are unreachable right now, and there is no public place to ask where they went. And if your company vets its dependencies by pointing at a GitHub page, that page is a 404 this morning, which is the kind of thing that makes a compliance review very interesting.</p>
<p>The practical steps are dull and they are the right ones. Pin the version you use instead of floating on "latest": 1.32.0 is the current release, and a pinned version does not care whether a repository exists. If you build from source, keep a vendored copy or a mirror you control; a repository you do not own is a dependency you do not control, and this morning is the demonstration. Watch the project's own site and Microsoft's channels for an explanation rather than the speculation threads, and do not migrate to a fork until there is an official word. A fork that appeared overnight has no history you can check.</p>
<p>The strangest part of this story is the silence. A 22,000-star project does not usually vanish without a word from anyone, and as of 00:18 UTC on 18 November, nobody from Microsoft has said one in public. Either there is a good reason and it will be explained, or there is a bad reason and it will be explained later. Until then, the facts are these: the code is gone from GitHub, the packages still install, and the people who depend on it are waiting for someone to say what happened.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[jQuery 4.1.0: What Actually Changed When I Upgraded a Real Page.]]></title><description><![CDATA[jQuery 4.1.0 landed on 17 November 2026, and the release notes read like a tidy list of small things: a new responseURL field on the object an Ajax call…]]></description><link>https://aheadkit.hashnode.dev/jquery-4-1-0-what-actually-changed-when-i-upgraded-a-real-page</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/jquery-4-1-0-what-actually-changed-when-i-upgraded-a-real-page</guid><category><![CDATA[jQuery]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[webdev]]></category><category><![CDATA[frontend]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Wed, 18 Nov 2026 01:32:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/ef4eadd1-70e1-4d76-870b-8e6b123c97ea.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>jQuery 4.1.0 landed on 17 November 2026, and the release notes read like a tidy list of small things: a new <code>responseURL</code> field on the object an Ajax call hands back, a stricter selector path, a ReDoS fix, form-associated custom elements in serialisation. Nothing in there looks like it should break your page. I upgraded a real test page from 3.7.1 to 4.1.0 and measured what actually changed, because release notes describe intentions and the page describes reality.</p>
<p>The page was a small one: a select with a disabled option group, an SVG circle, a two-field form, a three-item list, and a local server answering one JSON request. I ran the same probe against both versions — bundle sizes, selector behaviour, sorting, data on SVG, XML errors, serialisation, and one Ajax call — and compared.</p>
<p>The first difference is the one you can measure with a ruler. The minified build shrank from 87,533 bytes to 78,965, about 10% lighter. The full build went from 285,314 to 259,071 bytes, about 9% lighter. The slim build, the one without Ajax and effects, fell further, from 70,264 to 56,030 bytes, a 20% cut. For a library that has been accused of being heavy for a decade, a smaller 4.1.0 is a genuine improvement, and it is the only change in this upgrade you can feel without looking.</p>
<p>The second difference is the headline feature, and it works exactly as promised. In 3.7.1 the object returned by an Ajax call has no <code>responseURL</code> field at all. My probe reported <code>MISSING</code>. In 4.1.0 the same call returned the full address it actually fetched, <code>http://127.0.0.1:40025/thing</code>, with a 200 status. If you have ever chased a redirect through three layers of middleware wondering which address finally answered, that field is the answer, and it is now just there.</p>
<p>Everything else I probed behaved identically, which is also a result. The <code>:enabled</code> and <code>:disabled</code> selectors picked the same options in both versions: one enabled, two disabled, the pair inside the disabled group counting as disabled. <code>uniqueSort</code> collapsed the same duplicates to the same two elements. Storing data on an SVG circle worked in both. Broken XML threw the same error in both. Serialising the form produced the same <code>n1=v1&amp;n2=v2</code> in both. The release notes mention new semantics for <code>:enabled</code> and <code>:disabled</code> on options and option groups, and the notes mention new tests for data on SVG elements, but on my page the old version already behaved the way the new version promises. The changes are real; they just live in corners my page did not reach.</p>
<p>Timings were the one place I refused to draw a conclusion. Two thousand selector calls took 43.5 ms on 3.7.1 in one run and 123.6 ms in the next, on the same machine, same page, minutes apart. The 4.1.0 run came in at 28.8 ms, which looks like a win until you notice the spread on the old version is four times bigger than the gap. On a small shared machine, that number is weather, not evidence. I am not going to tell you 4.1.0 is faster. I will tell you it is smaller, and that the size numbers are stable across runs in a way the timings are not.</p>
<p>Two things did catch me out while upgrading, and both are worth knowing before you touch your own code. The first: jQuery 4.x locks down its package so you can no longer reach inside it for a file path. Asking for the minified build by its path fails outright, where 3.7.1 answered happily. If any of your tooling reaches into the package by path instead of importing it, that tooling breaks on upgrade. The second: 4.x needs a window with a document at the moment you load it, and throws if there is not one. 3.7.1 hands you a factory function and waits for you to supply the window. In a browser that difference is invisible. In a test setup that loads jQuery before it builds a page, it is the first error you meet.</p>
<p>So the honest summary of this upgrade is less dramatic than a version jump usually promises. Your selectors will not change, your forms will serialise the same way, your SVG data will still work, and your page will get about a tenth lighter. The one new thing you can actually use is <code>responseURL</code> on Ajax calls. The two things that can actually bite you are the locked-down package paths and the window requirement at load time. Neither is in the release notes' headline list, and both are the kind of thing you discover at midnight if nobody tells you first.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Java4Shell: I Ran the Published Trigger on a Vulnerable JDK. It Did Not Fire.]]></title><description><![CDATA[The headline version of Java4Shell is simple: a malformed Base64 string, 64 A characters followed by =, corrupts memory in OpenJDK, and from there the…]]></description><link>https://aheadkit.hashnode.dev/java4shell-i-ran-the-published-trigger-on-a-vulnerable-jdk-it-did-not-fire</link><guid isPermaLink="true">https://aheadkit.hashnode.dev/java4shell-i-ran-the-published-trigger-on-a-vulnerable-jdk-it-did-not-fire</guid><category><![CDATA[Java]]></category><category><![CDATA[Security]]></category><category><![CDATA[OpenJDK]]></category><category><![CDATA[vulnerability]]></category><dc:creator><![CDATA[Abdus Salam]]></dc:creator><pubDate>Wed, 18 Nov 2026 01:29:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ae4ec5d4e14ac3dd14cd7fc/004fa1ad-5c10-46ba-8bc4-3d62f027882f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The headline version of Java4Shell is simple: a malformed Base64 string, 64 <code>A</code> characters followed by <code>=</code>, corrupts memory in OpenJDK, and from there the researchers at Calif reached remote code execution in Keycloak, Jira, Jenkins and more. The version-number version of it is simple too: OpenJDK 17.0.6 and later, on an x86-64 chip with AVX-512 VBMI. I had both of those things on my desk, so I ran the trigger Calif published. It did not fire.</p>
<p>That is not a contradiction of their work. It is the most useful thing I found all morning, because it shows how much sits between "vulnerable version" and "exploitable box".</p>
<p>The bug itself is in the fast path OpenJDK uses to decode Base64. To go faster, the decoder uses AVX-512 VBMI instructions that chew through many bytes at once. Calif found that the hand-written assembly mishandles the padded tail of the input: for a 65-byte input it works out a negative output length, the mask that is supposed to limit the write becomes all ones, and 64 bytes get written where 50 were allocated. The decoder then rejects the input as invalid, but by then the bytes past the end of the buffer have already been overwritten. On older OpenJDK 17 the trigger is 128 <code>A</code> characters plus <code>=</code>. The write-up scores it 9.2 under CVSS 4.0 and calls it CVE-2026-114938.</p>
<p>Calif published a bounded trigger alongside the write-up: warm the decoder up with 200,000 valid decodes, then feed it the malformed input into a 4,096-byte array and count how many bytes past offset 50 changed. On an affected build it prints <code>REPRODUCED</code> with exactly 62 changed bytes, offsets 50 to 111. Every write stays inside a real array, so the trigger is safe to run. I ran that exact program.</p>
<p>My machine is an AMD EPYC 9D25 with all four flags Calif lists (<code>avx512f</code>, <code>avx512bw</code>, <code>avx512vbmi</code> and <code>bmi2</code>), and the JVM's own startup log confirms it sees <code>avx512_vbmi</code>. The vulnerable build was Eclipse Temurin 17.0.21+9, released 20 October 2026, a month before the patch. Its flags showed <code>UseAVX=3</code> and <code>UseBASE64Intrinsics=true</code>, so the fast path was switched on. The result:</p>
<pre><code>runtime=17.0.21+9
rejected=true changed=0 first=-1 last=-1
NOT REPRODUCED
</code></pre>
<p>I did not stop at one attempt. I ran a variant with a million warm-up decodes and the trigger 50 times in a row: 0 hits out of 50. I forced full compilation with <code>-Xcomp</code>: still 0. I set <code>-XX:UseAVX=3</code> explicitly: still 0. The decoder rejected the input every time, and nothing past offset 50 ever changed.</p>
<p>Then I ran the same program on the patched build, Amazon Corretto 17.0.21.1.2, released 17 November 2026: identical output, <code>changed=0</code>. And on the vulnerable Temurin build with the published mitigation flag <code>-XX:-UseBASE64Intrinsics</code>: identical again. Three builds, three identical-looking results. Which is exactly the problem. From the outside, a vulnerable build that does not take the fast path looks exactly like a patched build.</p>
<p>One more measurement hints at why. I timed 50 decodes of a 10 MB Base64 string: 612 ms with the intrinsics switched on, 450 ms with them switched off, 411 ms on the patched Corretto build. If the AVX-512 path were doing the work, the first number should have been the smallest by a clear margin. It was the largest. The fast path does not appear to be engaged on this box at all, despite the CPU flags and the JVM settings saying otherwise.</p>
<p>I do not know which link in the chain is missing here. It could be that this chip's AVX-512 implementation does not take the path Calif's Intel and AMD test machines took, or that the warm-up never selected the intrinsic stub for this call shape, or that something in how this VM presents the CPU keeps the decoder on its ordinary path. What I do know is what I measured, and what I measured says: having the vulnerable version and the right CPU flags did not reproduce the published trigger on my machine.</p>
<p>That leaves two practical conclusions, and they point in opposite directions. The first is reassuring: a version number alone does not prove a box is exploitable, and a lot of Java out there will never take this code path. The second is not: you cannot tell from the outside whether your box is one of the lucky ones. My vulnerable build and my patched build produced byte-identical output from the trigger. The only reliable test is the version string, and the only reliable fix is the patch.</p>
<p>So patch. Oracle's fixed builds are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1, released 17 November 2026, and every OpenJDK distribution built from the same code (Temurin, Corretto, Zulu, Liberica, SapMachine, Red Hat's build, Microsoft's) has its own fixed build on its own schedule. If patching has to wait, start the JVM with <code>-XX:-UseBASE64Intrinsics</code> and confirm the flag actually took: the setting is one line in a startup log, and it is worth more than a version number you have not checked. And if you run the published trigger yourself and it does not fire, do not treat that as a clean bill of health. I ran it on a build Calif lists as vulnerable, on a chip with every flag they list, and it did not fire either. The trigger proves exposure when it fires. When it does not fire, it proves nothing at all.</p>
<hr />
<p><em>P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam</em></p>
<p><a href="https://www.patreon.com/c/AheadKit"><img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/87bycvv0drlpbwxjppyi.png" alt="Buy me a coffee" /></a></p>
]]></content:encoded></item></channel></rss>