<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chen Yuan</title>
    <description>The latest articles on DEV Community by Chen Yuan (@chenyuan20509).</description>
    <link>https://dev.to/chenyuan20509</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3935918%2F55c92f67-ea0a-42da-a9f2-f44b2d4c60b2.png</url>
      <title>DEV Community: Chen Yuan</title>
      <link>https://dev.to/chenyuan20509</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chenyuan20509"/>
    <language>en</language>
    <item>
      <title>Ladybird's Alpha Is a New Test Target: Build a Small Cross-Engine Compatibility Suite</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Thu, 26 Nov 2026 19:25:59 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/ladybirds-alpha-is-a-new-test-target-build-a-small-cross-engine-compatibility-suite-527a</link>
      <guid>https://dev.to/chenyuan20509/ladybirds-alpha-is-a-new-test-target-build-a-small-cross-engine-compatibility-suite-527a</guid>
      <description>&lt;p&gt;What would happen if your application met a browser that had never inherited Chromium's implementation choices? The question is no longer entirely theoretical. On November 23, 2026, the Ladybird project announced an alpha release for macOS and Linux. Its announcement describes an independently built engine, a rolling update channel, support for WebDriver, and support for the Firefox DevTools protocol. It also explicitly warns that some websites will fail and that security guarantees are not yet available.&lt;/p&gt;

&lt;p&gt;That combination suggests a useful engineering exercise, not a recommendation to replace a daily browser. Treat the alpha as an additional compatibility target on a dedicated test machine. The following approach separates browser defects from application assumptions and produces evidence that another developer can reproduce. None of the examples below represents a benchmark or an observed Ladybird failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define the boundary before opening a browser
&lt;/h2&gt;

&lt;p&gt;Start with a small public test application or a local fixture containing synthetic data. Do not sign in to an employer's production dashboard or expose personal accounts, internal cookies, financial records, or privileged development credentials to an experimental browser. The project's own announcement makes this distinction particularly important. A test target is different from a supported production client.&lt;/p&gt;

&lt;p&gt;Record which release was installed and the operating system on which it runs. If the rolling channel updates between two test runs, the difference may reflect a changed engine rather than a changed application. Preserve the source revision of the application as well. A report that names only a browser brand and says that something stopped working is difficult to investigate.&lt;/p&gt;

&lt;p&gt;Choose a stable reference engine already present in your test environment. Firefox or Chromium may be appropriate, depending on what your team normally supports. The reference does not define the web standard by itself. It provides a comparison point that can help separate an incorrect fixture from an implementation difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a fixture with a narrow assertion
&lt;/h2&gt;

&lt;p&gt;A compatibility failure is easier to understand when it can be reproduced without the entire application framework, a database, and remote services. A checkout page with several hundred dependencies is a poor starting point for investigating a layout problem. A document with two elements and an explicit expected geometry is much more useful.&lt;/p&gt;

&lt;p&gt;For instance, the following document checks whether a simple grid lays out two fixed columns. The test is intentionally small enough to inspect visually and does not depend on external fonts or network requests. It can be served by a local static server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Grid fixture&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nc"&gt;.grid&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;grid-template-columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100px&lt;/span&gt; &lt;span class="mi"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.grid&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#abc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"grid"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"a"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"b"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#a'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBoundingClientRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#b'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBoundingClientRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'pass'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'fail'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A fixture like this is not a full test of CSS Grid. It checks exactly one relationship. That distinction matters when reviewing results. A browser may pass this fixture while failing a particular combination of intrinsic sizing, writing modes, or nested grid items. Add those conditions individually instead of changing several variables at once.&lt;/p&gt;

&lt;p&gt;Keep the same markup in both engines. Avoid adding conditional browser-specific CSS just to get the test to pass. A workaround may be appropriate for an application, but a reproduction should expose the original discrepancy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turn manual checks into explicit WebDriver assertions
&lt;/h2&gt;

&lt;p&gt;The project announcement states that WebDriver is supported. It does not establish that every browser-specific automation command works or that an existing Selenium configuration can start the browser unchanged. Follow the project's current setup instructions and confirm that a WebDriver endpoint is reachable before using a generic client.&lt;/p&gt;

&lt;p&gt;Once a session exists, a conventional W3C WebDriver command can navigate to the fixture and inspect its result. This example uses an existing session rather than inventing browser-specific capabilities or a driver executable. The driver endpoint, session identifier, and fixture address are supplied by the test environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"WEBDRIVER_URL"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rstrip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;sid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"WEBDRIVER_SESSION_ID"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;fixture&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"FIXTURE_URL"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{base}/session/{sid}"&lt;/span&gt;

&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{prefix}/url"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                  &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fixture&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raise_for_status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{prefix}/execute/sync"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"script"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"return document.body.dataset.result"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raise_for_status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"pass"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fixture must be accessible from the machine running the browser. A loopback address on the test runner does not necessarily refer to the browser host. If the machines differ, use an explicitly configured address and a network boundary appropriate for synthetic test data.&lt;/p&gt;

&lt;p&gt;Set a timeout on each command. A timeout is a different outcome from a false assertion. A stalled command could indicate that the test server is unreachable, the automation connection has failed, or a browser process stopped responding. Keep those outcomes distinct in the report.&lt;/p&gt;

&lt;h2&gt;
  
  
  Classify differences rather than counting failures
&lt;/h2&gt;

&lt;p&gt;A simple pass rate is attractive because it compresses a long test run into one number. However, it loses the information needed to decide what to fix. A missing optional JavaScript feature, a crash, and a one pixel rendering discrepancy have very different consequences. A compatibility suite should retain the assertion and actual result for each case.&lt;/p&gt;

&lt;p&gt;Use categories such as layout geometry, event handling, navigation, storage, network requests, accessibility, and automation transport. Each category should contain a narrow test that can be inspected independently. Include an unknown category when the evidence is insufficient to assign a cause. Do not convert uncertainty into a confident engine bug.&lt;/p&gt;

&lt;p&gt;When a test fails in both engines, inspect the fixture first. When it fails in only one engine, read the relevant specification and verify that the expected behavior is actually required. Browser agreement can be a useful clue, but agreement does not prove conformance. Conversely, a difference is not necessarily a defect if the specification permits implementation choices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep a reproducible result record
&lt;/h2&gt;

&lt;p&gt;A useful report includes the test identifier, browser build, operating system, fixture revision, expected value, and actual value. Preserve the failing fixture rather than depending on a mutable application URL. Store screenshots when the failure involves rendering, but do not rely on a screenshot alone for an assertion that can be represented as a number or a string.&lt;/p&gt;

&lt;p&gt;The following example classifies a fixture result without hiding transport failures behind an ordinary assertion failure. It writes a small local JSON report suitable for comparing two runs. The outcome is based on supplied observations, not a simulated performance measurement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;actual&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="n"&gt;transport_error&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"transport_error"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;transport_error&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"pass"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;actual&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"fail"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;test_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"engine"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"expected"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"actual"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;actual&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;transport_error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;save_report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reporting function does not try to decide whether the browser or the application is responsible. That is a separate investigation. Keeping observation and attribution separate makes the test suite more useful when a developer revisits an old report months later.&lt;/p&gt;

&lt;p&gt;Treat errors as potentially sensitive even in test environments. A request URL, console message, or screenshot might contain data that was not intended for a public bug tracker. Review attachments before sharing them. Synthetic fixtures make this easier because they avoid real customer data by design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the specification and existing test ecosystem
&lt;/h2&gt;

&lt;p&gt;The web platform already has a shared conformance test ecosystem: &lt;a href="https://web-platform-tests.org/" rel="noopener noreferrer"&gt;Web Platform Tests&lt;/a&gt;. Before writing dozens of custom tests for an engine feature, look for a relevant existing test and its expected behavior. An established test may reveal a subtle precondition that an application-level reproduction misses.&lt;/p&gt;

&lt;p&gt;For automation protocol details, the &lt;a href="https://www.w3.org/TR/webdriver/" rel="noopener noreferrer"&gt;WebDriver specification&lt;/a&gt; is a useful reference. It defines commands and responses that are distinct from a particular browser launcher's configuration. That separation is why the earlier example assumes that a session already exists.&lt;/p&gt;

&lt;p&gt;Use application fixtures for things that matter specifically to your product: keyboard behavior in a custom editor, focus movement in a dialog, or a rendering assumption in a chart component. Use shared conformance tests to investigate the underlying platform feature when a product fixture exposes a difference.&lt;/p&gt;

&lt;p&gt;Do not assume that a large conformance suite passing implies that every product workflow will work. User journeys combine features that individually appear correct. A login form may require focus handling, cookies, network redirects, and error rendering. Testing those interactions remains the application's responsibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide what belongs in the release gate
&lt;/h2&gt;

&lt;p&gt;At the alpha stage, a reasonable default is to run a compatibility experiment outside the mandatory release pipeline. Keep existing production browser support intact. A failure in the experimental target should create a triage item rather than block every deployment. This approach makes it possible to learn from a new engine without silently expanding the project's support obligations.&lt;/p&gt;

&lt;p&gt;If a failure reveals that the application relies on an unspecified behavior, consider fixing the application independently of the alpha. If the failure is isolated to the experimental implementation, preserve the fixture and report it through the project's supported channels. If the evidence is ambiguous, rerun the smallest reproduction on known builds before drawing a conclusion.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://ladybird.org/posts/alpha/" rel="noopener noreferrer"&gt;Ladybird alpha announcement&lt;/a&gt; asks web developers to report broken websites and describes the project's current limitations. A compact reproduction with an exact build and a stated expected behavior is a practical way to answer that request. The useful result is not a score showing which browser wins. It is a portable test that makes one part of the web easier to understand.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/ladybird-s-alpha-is-a-new-test-target-build-a-small-cross-engine-compatibility-suite" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>testing</category>
      <category>browser</category>
    </item>
    <item>
      <title>Two Million Canary Prompts Caught Providers Leaking: An Audit Playbook for Your LLM Supply Chain</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Sun, 22 Nov 2026 17:48:42 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/two-million-canary-prompts-caught-providers-leaking-an-audit-playbook-for-your-llm-supply-chain-49i2</link>
      <guid>https://dev.to/chenyuan20509/two-million-canary-prompts-caught-providers-leaking-an-audit-playbook-for-your-llm-supply-chain-49i2</guid>
      <description>&lt;p&gt;Picture a platform team at a mid-size fintech. They route customer-support summaries through an inference aggregator, and every request carries the flag their console calls Zero Data Retention. Compliance signed off months ago. The architecture diagram says a prompt goes in, a completion comes out, and nothing is kept. Then, on a Saturday in late November 2026, OpenRouter publishes a short announcement: three providers off-boarded, 125 endpoints stripped of ZDR eligibility, potentially affected customers notified. The team reads it twice and realizes something uncomfortable. The flag was never a property of their system. It was a promise, made by companies they had never heard of, covering infrastructure nobody in the room had ever audited.&lt;/p&gt;

&lt;p&gt;That announcement, and the research that forced it, is the most useful thing to happen to LLM procurement this year. Here is what it found, and a practical way to check your own stack this week.&lt;/p&gt;

&lt;h2&gt;
  
  
  What OpenRouter actually announced
&lt;/h2&gt;

&lt;p&gt;The facts first, because the details matter. On November 22, 2026, OpenRouter said security researchers had reported that certain inference providers "had data compromised or otherwise shown evidence that their data policies were not being upheld." OpenRouter itself was not breached. Its response was concrete: it off-boarded three providers, removed 125 endpoints from Zero Data Retention eligibility (including endpoints pulled as a precaution), and notified potentially affected customers whether or not those providers published anything publicly.&lt;/p&gt;

&lt;p&gt;Three provider notices are linked from the announcement. Novita posted a privacy notice regarding MiniMax requests. Phala posted a preliminary November incident report. Together posted a security event describing prompt leakage for requests in June and July of 2026. OpenRouter also said it is turning the researchers' testing approach into an ongoing check, verifying network paths to catch cases where requests are quietly forwarded to third parties, and requiring fresh assurances before any removed endpoint regains ZDR eligibility.&lt;/p&gt;

&lt;p&gt;The research behind this is a Dragos report with a blunt title: "Three breaches, endless leaks: Your AI supply chain needs canaries." Between July and November 2026, the researchers sent roughly two million prompts containing unique, trackable secrets to widely used AI services and watched where those secrets surfaced afterward.&lt;/p&gt;

&lt;h2&gt;
  
  
  The canary method in one paragraph
&lt;/h2&gt;

&lt;p&gt;The technique is older than LLMs and brutally simple. Every prompt carried identifiers that exist nowhere else: unique URLs hosted on the researchers' own infrastructure, and credential-shaped canary tokens that no legitimate system would ever use. If anyone fetches the URL or tries the credential, that access proves the prompt was read, stored, or passed along. No exploit, no insider, no questionnaire. You plant a secret that should stay sealed, and you watch the tripwires.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why ZDR is a claim, not a property
&lt;/h2&gt;

&lt;p&gt;The findings are uncomfortable reading for anyone who treats a retention toggle as a control. One lab's systems fetched the secret URLs from more than half of the prompts sent to its models between July and October, including roughly two-thirds of requests explicitly marked as no-data-collection or ZDR. Several United States hosting providers resell that lab's models, and prompts sent to those resellers triggered the same scraper, meaning the prompts flowed back to the lab behind them. A git client on a different cloud later tried to clone private repositories referenced in the prompts, but only for prompts that used that lab's models. One large American provider kept crawling a secret URL more than two months after it appeared in a single inference call to its search endpoint.&lt;/p&gt;

&lt;p&gt;The most striking case: twenty-four days after a prompt went to one provider, the secret link from that prompt was posted into a Feishu chat channel. The researchers' disclosure to that provider included only the first eight characters of the link, so whoever shared it was reading from a stored copy of the full prompt, more than three weeks after a request that carried a ZDR flag.&lt;/p&gt;

&lt;p&gt;Then there is the routing layer. The researchers traced about two thousand routes. Several hundred included a system they could not identify, and a handful sent data to a company that was not on the advertised path at all. One marketplace seller quietly appended roughly a thousand hidden tokens to every prompt. Another fetched images through a shared consumer subscription account. None of this requires a hacker. Standard logging at any of these middle layers is enough to read and keep your prompts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step one: map your real inference topology
&lt;/h2&gt;

&lt;p&gt;You cannot audit a path you have not drawn. For each model your applications call, write down the full chain you are actually paying for: your code, your gateway or aggregator, the provider the aggregator selects, any reseller behind that provider, and the lab that runs the weights. Aggregators make this deliberately fuzzy because routing is their product, so treat the advertised path as a hypothesis.&lt;/p&gt;

&lt;p&gt;Two cheap probes sharpen the picture. First, compare latency and behavior across regions and times; a route that changes shape at night is telling you something. Second, ask the provider directly, through support or your account team, which legal entity processes your request and where. Put the answers in writing. If the answer is "it depends," that is an answer too, and it belongs in your risk register.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step two: seed your own canaries
&lt;/h2&gt;

&lt;p&gt;You do not need two million prompts. You need a trickle of unique secrets that only your monitoring can explain. Mint one canary per endpoint per week, embed it in an otherwise normal prompt, and record exactly which route carried it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secrets&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="no"&gt;CANARY_BASE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://canary.example.com/t"&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mint_canary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;team&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;secrets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;token_urlsafe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;stamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;uid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{team}|{endpoint}|{token}|{stamp}"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{CANARY_BASE}/{uid}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"api_key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"sk-canary-"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;secrets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;token_urlsafe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"uid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"endpoint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"issued_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;stamp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The prompt itself should give a model a plausible reason to handle the secret without demanding it act on it, for example a debugging snippet that references the URL in a comment. Send it like any other request and log the pairing of canary id to endpoint, provider, model, and response id.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send_probe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;endpoint_cfg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;canary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt_text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;endpoint_cfg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prompt_text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"max_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;endpoint_cfg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Bearer "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;endpoint_cfg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                 &lt;span class="s2"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;t0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"endpoint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;endpoint_cfg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"uid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;canary&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"uid"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"latency_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;t0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"response_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A one to two percent sample rate on synthetic traffic is plenty. The point is coverage across routes and time, not volume.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step three: watch the places a prompt can surface
&lt;/h2&gt;

&lt;p&gt;The other half of the loop is a sink that alerts when a canary trips. Host the canary URLs on infrastructure you control, log every fetch with timestamp and network origin, and page a human when a fetcher is not the provider that was supposed to see the prompt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;classify_hit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;access_log_line&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;rec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;access_log_line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;uid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rsplit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;uid&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"ignore"&lt;/span&gt;
    &lt;span class="n"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;age_days&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rec&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ts"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"issued_at"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;86400&lt;/span&gt;
    &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"asn_org"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"unknown"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"expected_asn"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"expected-provider-fetch"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;age_days&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"alert: delayed third-party fetch"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"alert: unknown fetcher"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two patterns from the Dragos work are worth encoding directly. Alert harder on delayed fetches, because a fetch weeks later implies storage, not transit. And watch for git clone attempts against any repository a prompt ever referenced; that signal separated casual scraping from interested readers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step four: controls that actually bind
&lt;/h2&gt;

&lt;p&gt;Contracts first, but with teeth. A direct ZDR agreement with the provider that actually runs the model beats a checkbox inherited through two layers of resellers. Ask what happens to prompts at each hop, which subprocessors exist, and what evidence you will get after an incident. The Hacker News discussion of the OpenRouter post made the same point from the buyer side: the strongest ZDR agreement is the one your company holds directly, and plenty of teams are too small to get one, which is exactly who aggregators serve.&lt;/p&gt;

&lt;p&gt;Technical controls sit underneath the paper. Confidential inference on trusted execution environments is now advertised by multiple companies and removes whole classes of quiet logging, at the price of a smaller model menu. Self-hosting open weights moves the trust boundary onto hardware you own, which is why cost alone no longer explains the steady trickle of large firms going on-prem. And region pinning matters more than it looks: route rules that keep traffic inside jurisdictions you accept are a real constraint only if your gateway enforces them on every request, not as a dashboard default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;routing_policy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;require_zdr_contract&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;allowed_providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"provider-a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"provider-b"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;blocked_regions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"off-list-by-default"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;canary_sample_rate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.02&lt;/span&gt;
  &lt;span class="na"&gt;alert_channel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"inference-security"&lt;/span&gt;
  &lt;span class="na"&gt;review_cadence_days&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whatever you choose, write it as policy that the router evaluates, not as a wiki page. A rule that is not enforced at request time is decoration.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist you can run this week
&lt;/h2&gt;

&lt;p&gt;Pull your last ninety days of inference traffic and list every provider and model pair you actually used, not the ones you think you used. Check each against your aggregator's current ZDR eligibility list, because 125 endpoints just lost theirs and the list is the living document. Seed canaries through your top five routes and wire the sink alerts to a channel someone reads. Ask each critical provider, in writing, who processes your prompts and where. Then put the whole exercise on a thirty-day cadence, because the routing table next quarter will not be the one you audited today.&lt;/p&gt;

&lt;p&gt;The open secret of the inference market is that retention policies were honored mostly by reputation. Two million planted secrets just converted that reputation into measurements. The teams that come out ahead will not be the ones that panicked; they will be the ones that started measuring too.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/two-million-canary-prompts-caught-providers-leaking-an-audit-playbook-for-your-llm-supply-chain" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>Valkey Killed the Skiplist: What a 61-Way B+ Tree Buys Your Sorted Sets</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Sat, 21 Nov 2026 17:05:35 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/valkey-killed-the-skiplist-what-a-61-way-b-tree-buys-your-sorted-sets-5368</link>
      <guid>https://dev.to/chenyuan20509/valkey-killed-the-skiplist-what-a-61-way-b-tree-buys-your-sorted-sets-5368</guid>
      <description>&lt;p&gt;For most of two decades, one data structure owned a strangely specific job: keeping a sorted set sorted inside Redis, and later Valkey. Ask how ZADD, ZRANGE, or ZRANK found their way through millions of members, and the answer was always the same probabilistic tower of linked nodes. In Valkey 9.2, currently in release-candidate testing, that answer changes. The skiplist backing large sorted sets is gone, replaced by a high-fanout B+ tree variant called fbtree, short for Feature B+ Tree.&lt;/p&gt;

&lt;p&gt;The official numbers attached to the swap are hard to ignore. In a five-million-member test with 20-byte members, per-member index overhead fell from 50.3 bytes to 28.5 bytes on sequential inserts, a 43 percent reduction worth roughly 109 MB on that single key. Random inserts still saved 36 percent. Throughput on ZADD score updates rose 105 percent, and ZREM climbed 76 percent. Yet the more interesting story is not that a B+ tree beat a skiplist. It is why the skiplist was ever competitive, why it quietly stopped being competitive on modern hardware, and what fbtree's design says about where in-memory databases are heading.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hidden tax in a sorted set
&lt;/h2&gt;

&lt;p&gt;A large sorted set in Valkey is really two structures sharing one key. A hashtable maps each member to its score for O(1) point lookups, and an ordered index answers rank and range questions. Small sets never touch either one: below the listpack threshold, members live sequentially in one compact contiguous block, which is why the 9.2 change leaves small sets completely untouched.&lt;/p&gt;

&lt;p&gt;Once a set outgrows that threshold, the old design promoted it to a skiplist. The skiplist's elegance is that it needs no rebalancing: each node flips a weighted coin to decide how many levels it joins, and the expected structure stays balanced forever. The bill arrives in memory. Every node stores one element, and every node is its own allocation, scattered wherever the heap placed it. The official design notes put the overhead at roughly 37 bytes per node before the member string itself: an 8-byte backward pointer, an average of 1.33 extra levels at 16 bytes each for the forward pointer and span value, plus the 8-byte score.&lt;/p&gt;

&lt;p&gt;Here is that arithmetic in one place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Skiplist per-node index overhead, from the Valkey 9.2 design notes&lt;/span&gt;
&lt;span class="n"&gt;backward_ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;          &lt;span class="c1"&gt;# bytes&lt;/span&gt;
&lt;span class="n"&gt;avg_extra_levels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.33&lt;/span&gt;   &lt;span class="c1"&gt;# 25% chance of gaining each level&lt;/span&gt;
&lt;span class="n"&gt;per_level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;         &lt;span class="c1"&gt;# forward pointer + span value&lt;/span&gt;
&lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;

&lt;span class="n"&gt;overhead&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;backward_ptr&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;avg_extra_levels&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;per_level&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;overhead&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;           &lt;span class="c1"&gt;# about 37 bytes, member string not included&lt;/span&gt;

&lt;span class="c1"&gt;# On a 5,000,000-member set that is ~185 MB of pure index plumbing.&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;overhead&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;5_000_000&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a 20-byte member, the index describing the ordering cost nearly twice the data being ordered. That is the tax the new structure was built to repeal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the skiplist lost
&lt;/h2&gt;

&lt;p&gt;Raw bytes are only half the problem. The other half is latency hiding inside every lookup. Modern CPUs serve L1 cache hits in about a nanosecond, while a trip to DRAM costs on the order of a hundred. Skiplist traversal is a chain of dependent reads: you cannot know which node to visit next until the current one arrives from memory, and each node lives in an unpredictable location. The probabilistic leveling that makes inserts cheap also gives the structure an effective branching factor of about four, so a large set means many levels of waiting.&lt;/p&gt;

&lt;p&gt;The 2025 study the Valkey team cites, "Bridging Cache-Friendliness and Concurrency," measured traditional skiplists at roughly 2.4 to 4.8 times more cache misses than a comparable B-tree, with two to eight times lower throughput across its tested workloads. Those are different implementations than Valkey's, but the mechanism transfers directly. On Hacker News, where the announcement drew 177 points, long-time practitioners were blunt: skip lists were always a cache-miss liability on modern hardware, an idea from an era when theoretical and practical performance had not yet diverged this far.&lt;/p&gt;

&lt;p&gt;A B+ tree attacks both halves at once. Packing many entries per node slashes per-member pointer overhead, and reading one contiguous node replaces a chain of dependent fetches with one fetch plus cheap scanning inside a few cache lines, which hardware prefetchers handle well.&lt;/p&gt;

&lt;h2&gt;
  
  
  fbtree: a B+ tree shaped by the allocator
&lt;/h2&gt;

&lt;p&gt;fbtree keeps entries sorted in fixed-size nodes with a fanout of 61. That number is not arbitrary. Leaf and inner nodes are sized to land exactly on jemalloc allocation classes, so a 512-byte leaf holds up to 61 value pointers with no slack wasted to the allocator's rounding. On supported 32-bit builds, the inner node rounds up to the 1280-byte class instead. Sixty-one members now share a single allocation instead of sixty-one separate ones.&lt;/p&gt;

&lt;p&gt;The second decision is what a leaf actually stores. Rather than keeping the score and member apart and chasing pointers between them, fbtree packs them into one value: the normalized 8-byte score followed immediately by the member bytes. Everything a comparison needs sits in one place, and one more layer of indirection disappears.&lt;/p&gt;

&lt;p&gt;The shallower shape matters as much as the denser nodes. Both structures are O(log n) in theory, but a tree that branches 61 ways reaches five million members in about three levels, while the skiplist's branching factor of four needs far more hops, each one a potential dependent fetch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feature bytes: SIMD at the routing layer
&lt;/h2&gt;

&lt;p&gt;The design's namesake trick lives in the inner nodes. In a B+ tree keyed by variable-length strings, descending means comparing the lookup key against each child's anchor, the largest member stored beneath that child, and reading those anchor strings costs memory fetches of its own.&lt;/p&gt;

&lt;p&gt;fbtree stores each anchor alongside a small four-byte "feature," and because sibling anchors usually share a common prefix, that prefix is factored out and stored once. The four feature bytes per child are then comparable in parallel with SIMD instructions, often identifying the correct child before its node is ever fetched. When the features collide, they still narrow the range that needs a full binary search. It is a Bloom-filter-like sketch, except the sketch exists to steer traversal rather than to answer membership.&lt;/p&gt;

&lt;p&gt;The remaining optimizations target specific commands. Leaves are doubly linked, so ZRANGE walks sideways from leaf to leaf instead of climbing back up, and while the CPU works through up to 61 entries in one leaf, the next leaf can already be on its way. The leftmost and rightmost leaves are cached, keeping ZPOPMIN and append-style inserts at O(1) parity with the skiplist rather than regressing to O(log n). Range deletions remove a contiguous run without rebuilding the surrounding structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  The benchmark table, with its asterisks
&lt;/h2&gt;

&lt;p&gt;The throughput numbers deserve both the headline treatment and the fine print. Measured on a Graviton3 c7g.metal with 64 cores, nine I/O threads, a pipeline depth of ten, and a three-million-member set, repeated five times with confidence intervals at or below two percent for every command except ZRANDMEMBER:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Workload&lt;/th&gt;
&lt;th&gt;Throughput change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ZADD&lt;/td&gt;
&lt;td&gt;score update, all hits&lt;/td&gt;
&lt;td&gt;+105%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZREM&lt;/td&gt;
&lt;td&gt;50/50 random add/remove&lt;/td&gt;
&lt;td&gt;+76%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZCOUNT&lt;/td&gt;
&lt;td&gt;score-range count&lt;/td&gt;
&lt;td&gt;+27%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZRANK&lt;/td&gt;
&lt;td&gt;point rank lookup&lt;/td&gt;
&lt;td&gt;+19%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZRANGE&lt;/td&gt;
&lt;td&gt;100-element rank scan&lt;/td&gt;
&lt;td&gt;+6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZRANDMEMBER&lt;/td&gt;
&lt;td&gt;100 random samples&lt;/td&gt;
&lt;td&gt;+2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZSCORE&lt;/td&gt;
&lt;td&gt;point score lookup&lt;/td&gt;
&lt;td&gt;+2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZRANGEBYSCORE&lt;/td&gt;
&lt;td&gt;100-element score scan&lt;/td&gt;
&lt;td&gt;+1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZPOPMIN&lt;/td&gt;
&lt;td&gt;pop min plus append&lt;/td&gt;
&lt;td&gt;roughly 0%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The pattern is the point. ZADD and ZREM reposition elements inside the ordered index, so they collect the full benefit of the shallower tree and fewer pointer updates. Range commands gain less because once traversal gets cheap, producing and returning elements dominates the cost. ZSCORE and ZRANDMEMBER barely move for a simpler reason: they answered through the hashtable all along and never touched the skiplist.&lt;/p&gt;

&lt;p&gt;Two asterisks are worth repeating verbatim. The benchmarks were measured on the pull request's working branch, oi/pr3-fbtree-v2, and were not rerun on the merged commit. And the memory savings are per member, not per byte stored, so the relative win is largest for sets of many small members and shrinks as members grow. The underlying change itself is substantial: PR #4206, merged in August 2026, touched 36 files with over 9,100 additions, and reviewers on Hacker News singled out its unusually explicit review guide and scope boundaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually changes on your servers
&lt;/h2&gt;

&lt;p&gt;Functionally, nothing. Every sorted set command keeps its name, arguments, and behavior, which is exactly the contract an internal representation swap should honor. The one visible difference is introspection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;127.0.0.1:6379&amp;gt; ZADD bigz 1 "member-a"
(integer) 1
127.0.0.1:6379&amp;gt; OBJECT ENCODING bigz
"listpack"

# ... after the set crosses the listpack threshold on 9.2:

127.0.0.1:6379&amp;gt; OBJECT ENCODING bigz
"btree"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your monitoring, tests, or tooling assert on the literal string "skiplist," that is the one place to update before upgrading. Small sets are unaffected in both directions: under the defaults shipped in valkey.conf, zset-max-listpack-entries 128 and zset-max-listpack-value 64, they were listpacks before and they stay listpacks now. Those thresholds remain the knobs to tune only after measuring your real dataset, as the config file itself warns.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to test it before GA
&lt;/h2&gt;

&lt;p&gt;Valkey 9.2 is still a release candidate, and the team is explicitly asking for workload testing before general availability, especially from operators whose traffic leans on ZADD, ZREM, ZRANK, or ZCOUNT against large sets. A meaningful before-and-after check needs only three ingredients: your member size distribution, your insert order, and steady-state memory readings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Fill a large set with pipelined random-score writes
valkey-benchmark -n 1000000 -P 10 -r 1000000 \
  ZADD bigz __rand_int__ member:__rand_int__

# Then compare index cost across builds with:
127.0.0.1:6379&amp;gt; MEMORY USAGE bigz
(integer) ...
127.0.0.1:6379&amp;gt; OBJECT ENCODING bigz
"btree"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Divide MEMORY USAGE by ZCARD on each build and compare against the official deltas: 50.3 bytes per member on the skiplist build, 28.5 on fbtree with sequential inserts, 32.0 with random order. If your members are larger than 20 bytes, expect the relative saving to shrink accordingly, and if your access pattern is update-heavy, watch ZADD and ZREM latency rather than range scans. Report what you find: the whole point of the RC window is surfacing regressions while they are still cheap to fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pattern behind the swap
&lt;/h2&gt;

&lt;p&gt;The skiplist was never a bad choice. It was a good answer to a 1990s hardware question, when a pointer chase cost roughly what an arithmetic operation cost and simplicity of concurrent design was worth real money. Hardware moved, and the cost model inverted: computation is nearly free, while waiting on memory dominates everything. The Valkey change is one more entry in a long migration, from pointer-heavy structures toward flat, wide, cache-resident layouts, the same migration that rewrote hash tables, database buffer managers, and language runtimes over the past decade.&lt;/p&gt;

&lt;p&gt;What makes this instance worth studying is the discipline around it. The team benchmarked through the full server rather than in a microbenchmark vacuum, added optimizations until fbtree matched or beat the skiplist on every tested command, kept the operator-visible surface unchanged, and shipped the change behind a release candidate with an explicit request for adversarial workloads. When your fastest path is the one nobody notices, that is what a mature infrastructure project looks like.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/valkey-killed-the-skiplist-what-a-61-way-b-tree-buys-your-sorted-sets" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>An AI Swarm Designed Its Own CPU: What Frostbite's 4.59x Perf-Per-Watt Claim Actually Rests On</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Fri, 20 Nov 2026 17:15:52 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/an-ai-swarm-designed-its-own-cpu-what-frostbites-459x-perf-per-watt-claim-actually-rests-on-b71</link>
      <guid>https://dev.to/chenyuan20509/an-ai-swarm-designed-its-own-cpu-what-frostbites-459x-perf-per-watt-claim-actually-rests-on-b71</guid>
      <description>&lt;p&gt;The most interesting number in Architect Labs' Frostbite announcement is not the headline 4.59x performance-per-watt win over a modern CPU core. It is a different number entirely: 15 of the 25 workloads in the final evaluation were held out until the design was frozen, and on those never-tuned programs the chip still claims a 3.83x geometric mean. Whether or not that figure survives contact with real silicon, the discipline behind it is what separates this announcement from the average AI-hardware press release.&lt;/p&gt;

&lt;p&gt;Frostbite is a general-purpose CPU with a brand-new instruction set, designed end-to-end by AI agent swarms: compiler, ISA, architecture, microarchitecture, RTL, verification, and the final GDS layout. The company says the program ran with zero architectural priors, meaning no human picked the organization of the machine. What the humans built instead was the guardrail system that kept the swarm's decisions honest.&lt;/p&gt;

&lt;p&gt;This article walks through what Frostbite actually is, the interaction-net idea underneath it, the design loop that produced it, and how an engineer should read the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  The claim, stripped to its numbers
&lt;/h2&gt;

&lt;p&gt;Start with the silicon-shaped facts. Frostbite was synthesized on a 7 nm process, reached 800 MHz timing at synthesis, and closed at 500 MHz in the final GDS. The comparison unit is one Frostbite quad, a two-by-two grid of tiles paired with four L3 nodes, occupying 0.792 mm², benchmarked against a single core of what the company calls a TCPU: a modern, silicon-proven, superscalar, dual-issue, in-order CPU occupying 0.895 mm² on the same process. The exact part is unnamed, for legal reasons.&lt;/p&gt;

&lt;p&gt;Across all 25 workloads, the reported geometric mean is 4.59x the TCPU's performance per watt: 6.02x on the 10 workloads the agents tuned against, 3.83x on the 15 held-out ones. Average performance per area is 8.77x. The energy breakdown tells the mechanistic story. Excluding clock distribution, which eats 49 percent of the TCPU's energy and 41 percent of a Frostbite quad's, the traditional core spends 57 percent of its energy on memory and 27 percent on fetching, decoding, and issuing instructions. Frostbite cuts memory to 38 percent and fetch-decode-issue to 6 percent, and in exchange spends 26 percent on its on-chip network and schedulers, the cost of moving work between tiles.&lt;/p&gt;

&lt;p&gt;Those are pre-silicon numbers from correlated simulation, and the comparison core is an in-order dual-issue design rather than a wide out-of-order flagship. Hold both facts; they matter at the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem conventional cores cannot stop paying for
&lt;/h2&gt;

&lt;p&gt;Mainstream languages compile to a model where any instruction may read or write any part of shared mutable state. The dependencies between instructions are thrown away at compile time, so the hardware has to rediscover them at runtime. That rediscovery is what a modern core spends its area and energy on: register renaming, reorder buffers, speculation, and the cache-coherence machinery that preserves the illusion of one shared memory across cores.&lt;/p&gt;

&lt;p&gt;Single-core performance has largely stalled since the early 2000s, and the industry's answer, more cores, makes the coherence problem worse, because keeping the shared-memory illusion consistent across many cores costs area and power that scale poorly. Frostbite's bet is that the whole expense is self-inflicted: it exists because the program's true dependency structure was discarded, not because the dependencies were never there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interaction nets in five minutes
&lt;/h2&gt;

&lt;p&gt;The alternative model is old. Interaction nets were introduced by Yves Lafont in 1990. A program is a graph of nodes connected through ports, and computation proceeds by rewriting pairs of nodes connected through their principal ports. Three properties do all the work. Every rewrite is local, touching only a small part of the graph. Every dependency is explicit in the wiring. And the system is linear: every value has exactly one owner and is used exactly once, so there is no shared mutable state for hardware to guard. Because no two active pairs ever overlap, all ready rewrites can fire at once, in any order, with the same result.&lt;/p&gt;

&lt;p&gt;The announcement's small example is the five-queens puzzle. A sequential C++ program walks the search tree one candidate at a time. The same search expressed as an interaction net exposes its independent work directly: 3,183 interactions in total, with a critical path of only 262 steps, and on average about twelve interactions ready to run at every step. Nobody parallelized the program; the parallelism was never thrown away in the first place.&lt;/p&gt;

&lt;p&gt;Programs for Frostbite are written in Vine, a Rust-flavored language that compiles to Ivy, an intermediate representation encoding the net structure. The optimizer applies graph-reduction rules statically, so the final net has a mostly fixed shape of data, computation, and control nodes, but the runtime behavior stays dynamic, because the parallelism has to be derived from the state of the net as it executes and pipelined across space rather than time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;; five queens, schematically: a sequential walk vs a net
; sequential: visit board candidates one at a time, depth first
; net:        every candidate branch becomes a live subgraph

place_queen(board, col):
    if attacks(board, col): return nothing
    if full(board):         emit solution
    else:                   spawn place_queen(board + col, c) for each c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each spawned branch is independent by construction, because the board value is linear and no two branches can ever write the same state. A conventional core would recover a fraction of that parallelism with a wide out-of-order window; the net hands all of it to the hardware for free.&lt;/p&gt;

&lt;h2&gt;
  
  
  The design loop: swarms, contracts, and a deleted PDF
&lt;/h2&gt;

&lt;p&gt;The process matters more than the architecture, because the process is the part that generalizes. It started with workload design. The team defined categories for how programs expose work: many independent pieces at once, rounds of parallel work, long sequential chains, data-dependent branches, recursion. Under each category they built a search set and a held-out evaluation set. The FFT, radixsort, and LU kernels follow SPLASH-2 implementations shrunk 64-fold, because full sizes are unsuitable for exploratory iteration. Later, five practical workloads joined the held-out set: a Kalman filter, PCA, finite element analysis, an LU solve, and LZ4 decompression.&lt;/p&gt;

&lt;p&gt;Agent swarms then synthesized research papers and existing benchmarks into Python models, traded high-level architectural ideas against each other, and narrowed to one concept written up as a 141-page PDF. Here is the detail that should make every engineer sit up: once the first RTL iteration existed, the PDF was deleted. Many of its numbers were simply wrong about what was physically possible, and a stale natural-language document is a liability; it cannot be checked, only believed.&lt;/p&gt;

&lt;p&gt;The replacement was ASL, an in-house specification language with machine-checkable translations between RTL, system models, UVM, and SVA, all against a formally backed specification. ASL translates natively to Lean for theorem proving, and by the end of the program the Frostbite specification had lowered to more than 800,000 lines of Lean across 31 blocks. The chip's software model, Arcmodel, runs about 200 times faster than RTL simulation and is supposed to be accurate to within 1 to 5 percent on power and performance.&lt;/p&gt;

&lt;p&gt;Supposed to be. Arcmodel is not physically aware, and its early estimates diverged from timing-converged, synthesis-clean RTL by up to 250 percent. So one of the autonomous pipelines recalibrates the model against the RTL: it finds power hotspots, traces them to counters in the formal specification, such as SRAM reads and writes, operation counts, flits sent and received, credit returns, and frame misses, then fits an arbitrary scalar Python function over those counters and repeats until model and RTL agree within 5 percent. After alignment, Arcmodel simulations ran 660 times faster than RTL, and the swarm could afford to iterate across the stack: the post describes fine-grained clock-gating tricks discovered by the agents, with the software runtime adjusted to match within hours.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# the recalibration loop, schematically&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;recalibrate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arcmodel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rtl_traces&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tolerance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;counters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"sram_reads"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"sram_writes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"op_counts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"flits_sent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"flits_recv"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"credit_returns"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"frame_misses"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;hotspots&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;find_power_hotspots&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rtl_traces&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;trace_to_spec_counters&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hotspots&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;counters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;model_fn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fit_scalar_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arcmodel&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rtl_traces&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;energy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;arcmodel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update_power_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model_fn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;relative_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arcmodel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rtl_traces&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;tolerance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;arcmodel&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the model and RTL agreeing, the swarm ran four searches plus a final ablation round: 58 architectural ideas tried, 37 kept, each implemented in a parallel worktree and checked against the contracts before landing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The emergent part: work stealing nobody specified
&lt;/h2&gt;

&lt;p&gt;The report's most striking claim is not a number but a behavior. Because Frostbite spreads parallelism over space, it has no central scheduler. Each tile follows three rules: run your own work first; if you have none, take work from a neighbor that has some to spare; if no neighbor does, go inactive and save power. The compiler breaks code into short sections that run uninterrupted once their inputs are ready. When a loop or branch splits into parallel pieces of unknown size, the running section parks its continuation into a small record managed by the frame manager, drops the new tasks onto a hardware work queue, and picks up the newest one itself. Idle neighbors pull the remaining tasks over the network, and as tasks finish anywhere on the chip, their return packets tick down the parked record's counter, waking the next section the moment the last piece arrives.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tile rule loop (per tile, per cycle):
    if input_ports.nonempty():      run own work
    elif neighbor.has_spare_work(): pull one task over the network
    else:                           clock-gate until a packet arrives
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The company says this behavior was never specified by any human and can be traced back to necessity on specific regressions and hill-climbing metrics. That is the kind of sentence that would be marketing fluff in a weaker report, except that here the specification is machine-checkable, so the claim is at least auditable in principle.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to read results like this
&lt;/h2&gt;

&lt;p&gt;Now the engineering skepticism, because the Hacker News comment thread supplied plenty. The benchmark kernels are small: JSON parsing over 4,096 characters, mergesort over 1,024 elements, Fibonacci of 20, as one commenter flagged immediately. The comparator is a dual-issue in-order core, not the kind of wide out-of-order design that ships in a flagship processor, and it is unnamed. The power numbers are pre-silicon, from a model that originally missed by 250 percent before being correlated. Interaction nets have been around for 35 years without a production win, and the history of computing is littered with elegant parallel architectures, from the Transputer to the Mill, that lost to the boring incumbent's ecosystem.&lt;/p&gt;

&lt;p&gt;All fair. But the held-out methodology is exactly the discipline the field keeps asking AI claims to show, and the company's own split is honest about the tuning gap: 6.02x on workloads the agents optimized against, 3.83x on workloads they never saw. The promised next steps are the right ones too: benchmarking larger mesh configurations against multi-core TCPUs with big caches and wider out-of-order designs, on SPEC and PARSEC rather than toy kernels; an FPGA-hosted playground where anybody can run a program on Frostbite; a preliminary operating system; and a public release of the RTL and ISA. Every one of those is falsifiable.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes even if Frostbite never ships
&lt;/h2&gt;

&lt;p&gt;Strip away the specific chip and the durable claim is about economics. Architecture exploration has always been limited by the cost of conviction: a human team needs years and a fortune to take an out-of-distribution idea seriously enough to evaluate it honestly, so most ideas never get evaluated at all. If agent swarms bound by formal contracts can carry a concept from workload selection to a verified GDS layout, the price of exploring a strange idea collapses, and the set of designs that get a fair hearing grows accordingly. The deleted 141-page PDF is the tell: in this workflow, natural language is a scratch space, and the only artifact allowed to persist is one a theorem prover can check.&lt;/p&gt;

&lt;p&gt;The 4.59x figure may or may not survive real silicon. The more durable claim is that a machine-checked contract, not a bigger prompt, is what lets an AI organization design hardware without drifting into nonsense, and that claim can be tested by anyone once the RTL and ISA are public.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/an-ai-swarm-designed-its-own-cpu-what-frostbite-s-4-59x-perf-per-watt-claim-actually-rests-on" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>One VM, 15 Million Web Servers: The Per-Socket Tax Your Kernel Charges</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Thu, 19 Nov 2026 17:17:05 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/one-vm-15-million-web-servers-the-per-socket-tax-your-kernel-charges-2jck</link>
      <guid>https://dev.to/chenyuan20509/one-vm-15-million-web-servers-the-per-socket-tax-your-kernel-charges-2jck</guid>
      <description>&lt;p&gt;How many web servers can one virtual machine hold? Not how many requests it can answer per second, and not how many containers you can squeeze onto it, but something more literal: how many servers can each open a socket, listen on their own address, and answer a request, all at the same time?&lt;/p&gt;

&lt;p&gt;A writeup published this week by kapteko asked exactly that question under a hard budget: one VM, ten gigabytes of RAM, one CPU core, and a target of fifteen million web servers. It reads like a joke whose punchline is fixing the economics of hacking by making servers too abundant to attack, but underneath the humor sits one of the clearest public walkthroughs of what the Linux kernel actually charges you for networking, and what it costs to stop paying. Every wall the experiment hits is a wall that real systems hit later and rename as an outage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wall one: the kernel runs out of ports
&lt;/h2&gt;

&lt;p&gt;The experiment starts with the smallest honest web server you can write in C: create a socket, listen, accept, read, reply, close.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;AF_INET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SOCK_STREAM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;128&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"HTTP/1.0 200 OK\r\nContent-Length: 2\r\n\r\nOK"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;accept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;recv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4096&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;MSG_TRUNC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;MSG_NOSIGNAL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On one core this loop answers around 65 thousand requests per second, which sounds like a fine start. Then the experiment tries to launch fifteen million copies and dies at copy number 28,232. The failure is not CPU or memory. It is &lt;code&gt;listen&lt;/code&gt; returning an error, because each server asked for port zero, and the kernel assigns those from &lt;code&gt;net.ipv4.ip_local_port_range&lt;/code&gt;, which defaults to 32768 through 60999. That is roughly 28 thousand ports, and the experiment just exhausted every one of them.&lt;/p&gt;

&lt;p&gt;Widening the range to the full 1 through 65535 space buys only about 64 thousand more, because a port is a sixteen-bit field baked into the TCP header itself. No sysctl stretches a protocol constant. The real escape hatch is a different observation: a listening socket is identified by the tuple of protocol, IP address, and port, so fresh addresses multiply the port space for free. Linux supports exactly this through a feature called AnyIP, which lets one machine listen on an entire routed subnet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ip -6 route add &lt;span class="kd"&gt;local&lt;/span&gt; 2001:db8:1234:5678::/64 dev lo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A single /64 prefix is about 18 quintillion addresses, which is generous headroom. The IPv4 equivalent is theoretically identical and practically awkward, since a routable block with fifteen million addresses trades at roughly a quarter of a billion US dollars these days. Address space, not silicon, is the scarce resource.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wall two: every socket costs 3,384 bytes, even idle
&lt;/h2&gt;

&lt;p&gt;With addressing solved, the next question is memory, and here the experiment catches a widely repeated claim being wrong. Ask a language model how much RAM an idle TCP connection takes and it will answer confidently: zero for idle, about five kilobytes for active. The experiment believed this, allocated fourteen million idle listening sockets, and watched the machine run out of memory almost immediately.&lt;/p&gt;

&lt;p&gt;The truth is visible in the kernel source. A single TCP socket on Linux carries roughly 3,384 bytes of bookkeeping before one byte of user data moves. &lt;code&gt;struct tcp_sock&lt;/code&gt; alone is 2,240 bytes of state for queues, timers, sequence numbers, congestion control, and retransmit accounting. &lt;code&gt;socket_alloc&lt;/code&gt; adds 768 bytes for the socket object and its sockfs inode. The &lt;code&gt;file&lt;/code&gt; structure costs 184 bytes, and the &lt;code&gt;dentry&lt;/code&gt; for the pseudo-filesystem name costs 192. None of this is a buffer you can tune away with sysctl; it is the price of the kernel remembering that your socket exists.&lt;/p&gt;

&lt;p&gt;Multiply by the target and the math turns brutal: fifteen million kernel sockets need about 48 gigabytes of RAM, five times the whole budget, before any server answers a single request. In the configuration the experiment actually measured, the stock networking path ran the machine dry at roughly 2.5 million servers, with throughput decaying well before that point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wall three: a process per server is worse
&lt;/h2&gt;

&lt;p&gt;Even with free sockets, the classic Unix design would still lose. A minimal compiled server process costs about 1.5 megabytes of RAM, so fifteen million of them would need on the order of twenty terabytes. The only way forward is the move language runtimes made years ago: put every guest inside one process and schedule them yourself.&lt;/p&gt;

&lt;p&gt;The writeup builds this on LFI, a sandboxing scheme from Stanford research that gives each guest memory isolation and, crucially, replaces every syscall with a call into the host runtime. That replacement is the whole trick: once the kernel is no longer involved in guest I/O, the runtime can implement networking however it wants. The machine becomes its own tiny operating system, with a scheduler that round-robins between guests.&lt;/p&gt;

&lt;p&gt;How small can per-guest state get? Look at the server loop again. Between any two scheduling points, the only live values are the program counter and two file descriptors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;Context&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;pc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;u64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;        &lt;span class="c1"&gt;// where to resume&lt;/span&gt;
    &lt;span class="n"&gt;fd_server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;i32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// listening socket&lt;/span&gt;
    &lt;span class="n"&gt;fd_client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;i32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// current client&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sixteen bytes per guest, and less if you pack aggressively. Fifteen million guests of scheduling state fit in about 220 megabytes. Combine that with the corrected memory model — fourteen million idle connections held inside a userspace stack, one million active connections at five kilobytes each — and the total lands near five and a half gigabytes: just over half the budget. The plan survives contact with arithmetic. Now it has to survive contact with the network card.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wall four: TCP has to leave the kernel
&lt;/h2&gt;

&lt;p&gt;TCP is the stateful part of the stack; everything below it is stateless framing, so nothing forces the TCP implementation to live in the kernel. Embedded engineers have carried their own stacks for decades, and Adam Dunkels famously shipped Miniweb, a TCP/IP stack plus HTTP server that runs in twenty-eight bytes of RAM. Mature options exist at every weight class: gVisor reimplements the entire operating system interface including networking, Seastar ships a full runtime with its own stack, lwIP is the classic C implementation, and F-Stack ports the FreeBSD stack wholesale.&lt;/p&gt;

&lt;p&gt;The experiment picks smoltcp, a standalone event-driven TCP/IP stack written in Rust for bare-metal systems. The choice is well supported: the crate needs no heap allocation, carries a 0BSD license, sits at roughly 4.7 thousand GitHub stars, and shipped release v0.14.0 in August 2026 with commits still landing this month. But smoltcp is deliberately only the protocol half. It parses and emits packets; it cannot move one byte to the wire by itself. You feed it through a device abstraction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Instant&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;iface&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;poll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;sockets&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;wait&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_raw_fd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iface&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;poll_delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;sockets&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything interesting hides inside what &lt;code&gt;device&lt;/code&gt; is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feeding the stack: TUN, TAP, DPDK, AF_XDP
&lt;/h2&gt;

&lt;p&gt;There are four realistic ways to connect a userspace stack to the wire, and they differ in how much of the kernel you keep paying for.&lt;/p&gt;

&lt;p&gt;TUN is a virtual kernel interface at the IP layer; TAP does the same job at the Ethernet layer. Both are easy — smoltcp supports them out of the box — but packets still cross the kernel boundary on every trip, so the per-syscall and per-copy costs remain.&lt;/p&gt;

&lt;p&gt;DPDK removes the kernel from the data path entirely. The application talks to the network card through memory-mapped ring buffers: sending is writing to memory, receiving is reading memory the card already filled. Context explains why anyone bothers. A syscall costs on the order of 500 nanoseconds, and a kernel-to-userspace copy perhaps another 1,000, while a trading firm saturating a 400-gigabit link must process up to 600 million packets per second — 1.7 nanoseconds per packet. At that budget you cannot afford to even ask the kernel a question. The catch is operational: the poll loop pins an entire core at one hundred percent, and the DPDK driver takes exclusive ownership of the card. The interface vanishes from &lt;code&gt;ifconfig&lt;/code&gt;, and if that card carried your SSH session, the session is gone.&lt;/p&gt;

&lt;p&gt;AF_XDP is the modern middle path. The kernel keeps owning the device, but a small eBPF program attached at the XDP hook decides per packet whether to redirect the frame straight into a userspace memory region — bypassing the whole network stack — or hand it to normal processing. The region is managed as receive and transmit descriptor rings per socket, plus fill and completion rings over a shared UMEM buffer, which yields zero-copy I/O while SSH, monitoring, and every other kernel consumer keep working. A &lt;code&gt;SO_PREFER_BUSY_POLL&lt;/code&gt; mode trades a core for interrupt-free polling when you want behavior even closer to DPDK. For smoltcp specifically, the &lt;code&gt;rust-dpdk-net&lt;/code&gt; and &lt;code&gt;xsk-rs&lt;/code&gt; crates already wrap the two fast paths, so the device trait is the only glue left to write.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the final benchmark says
&lt;/h2&gt;

&lt;p&gt;The writeup closes with the comparison the whole piece builds toward. The kernel path dies around 2.5 million servers when RAM runs out. The userspace path slows memory growth to about 620 bytes per idle server and roughly one kilobyte per active one, which is how the experiment finally passes its target: sixteen million web servers, alive, on ten gigabytes. On throughput, DPDK wins the benchmark outright with AF_XDP close behind — the expected result, since AF_XDP keeps a thin slice of kernel involvement that DPDK does without. The full proof of concept, including the scheduler, the LFI plumbing, and all four network backends, is public in the author's AI10M repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this buys you at normal scale
&lt;/h2&gt;

&lt;p&gt;Nobody needs fifteen million web servers. But the per-socket tax applies at every scale: a million idle WebSocket or SSE connections — ordinary for a chat product or a mobile backend — cost about 3.4 gigabytes of kernel memory before your application does anything at all. Knowing that number changes how you argue about architecture. Connection-heavy services can budget for the tax explicitly, move idle state out of the kernel with a userspace stack on the hot path, or adopt AF_XDP where operations teams cannot hand a network card to a single process. The joke experiment turns out to be a measurement of a price most of us pay without ever reading the receipt.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/one-vm-15-million-web-servers-the-per-socket-tax-your-kernel-charges" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>Pre-Auth RCE in nginx HTTP/2: The WINDOW_UPDATE Accounting Bug Five Teams Found at Once</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Wed, 18 Nov 2026 17:34:35 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/pre-auth-rce-in-nginx-http2-the-windowupdate-accounting-bug-five-teams-found-at-once-ehb</link>
      <guid>https://dev.to/chenyuan20509/pre-auth-rce-in-nginx-http2-the-windowupdate-accounting-bug-five-teams-found-at-once-ehb</guid>
      <description>&lt;p&gt;On November 18, 2026, two links reached the Hacker News front page within the same hour. The first was a Wiz Research write-up titled "Pre-auth RCE in Nginx HTTP/2 handling." The second was a page called NGINX2Root with a tagline that needs no translation: from nginx visitor to root of the server host. By the time the thread passed three hundred points, one sentence from the Wiz post had become the real story. Wiz Research, Ikotas Labs, Metnir, Rapid7, and Xint had independently uncovered the same vulnerability class. Five teams, one bug, no coordination.&lt;/p&gt;

&lt;p&gt;Here is the part that should make every operator uneasy. The fix was already public. It landed in the nginx repository on November 11 as an unassuming commit and shipped the same day in mainline 1.31.9 and stable 1.30.7, a full week before anyone said the letters RCE out loud. On disclosure day, the only new commit on master was a version bump to 1.31.10 at 16:40 UTC. The patch hid in plain sight for seven days, and anyone diffing releases for n-days had a running start.&lt;/p&gt;

&lt;p&gt;This is an anatomy of that bug: what HTTP/2 flow control is supposed to enforce, the exact counter nginx forgot to subtract, the four-line patch that closes the hole, and the operational traps that will leave hosts vulnerable long after they believe they are patched.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two headlines, one bug
&lt;/h2&gt;

&lt;p&gt;The public record pieces together cleanly. Wiz Research published the long-form analysis of a pre-authentication remote code execution flaw in nginx's HTTP/2 request handling. Xint, one of the five credited discoverers, published NGINX2Root, which claims a full chain from an unauthenticated HTTP/2 connection to code execution on the server host, and lists five assigned CVEs: CVE-2026-123007, CVE-2026-123634, CVE-2026-123633, CVE-2026-121810, and CVE-2026-113425.&lt;/p&gt;

&lt;p&gt;The nginx side of the story is a single commit, e27f5fa84f, dated November 11 and credited as reported by Xint.io. Its message does not mention RCE at all. It describes a flow-control accounting error that leads to memory corruption and a possible segmentation fault. That gap between the dry commit message and the loud disclosure is normal security practice: fix first, ship the fix in routine releases, then disclose once the patched versions exist.&lt;/p&gt;

&lt;p&gt;What is less normal is the collision. Five independent reports of the same bug class in the same week suggests either the bug was more visible than anyone assumed, or the tooling for finding such bugs has gotten dramatically better. The Hacker News thread speculated loudly about AI-assisted vulnerability discovery, but that remains speculation. What is verifiable is the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP/2 flow control in sixty seconds
&lt;/h2&gt;

&lt;p&gt;HTTP/1.1 has no flow control worth the name: one request, one response, one connection mostly idle. HTTP/2 multiplexes dozens of streams over a single TCP connection, and that creates an immediate problem. A fast server can bury a slow client. The protocol's answer, from RFC 7540, is credit-based flow control.&lt;/p&gt;

&lt;p&gt;Every HTTP/2 connection carries a connection-level flow-control window, and every stream inside it carries a stream-level window. Sending DATA frames spends window. The receiver grants more credit by sending WINDOW_UPDATE frames, each carrying an increment that the sender adds to its available window. The window is a 31-bit unsigned integer, so the protocol ceiling is 2,147,483,647 bytes, one byte short of 2 GiB. A receiver may never grant credit that pushes the sender's window past that ceiling, and a sender that receives such credit is required to treat it as a connection error of type FLOW_CONTROL_ERROR.&lt;/p&gt;

&lt;p&gt;nginx enforces the ceiling in its HTTP/2 module with a constant and a check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#define NGX_HTTP_V2_MAX_WINDOW           ((1U &amp;lt;&amp;lt; 31) - 1)&lt;/span&gt;

&lt;span class="cm"&gt;/* validating an incoming WINDOW_UPDATE increment */&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;NGX_HTTP_V2_MAX_WINDOW&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;h2c&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;send_window&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;ngx_http_v2_connection_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h2c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;NGX_HTTP_V2_FLOW_CTRL_ERROR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The check reads correctly. The increment is rejected if accepting it would push the connection's send window past the protocol maximum. The bug is that the arithmetic is missing one term.&lt;/p&gt;

&lt;h2&gt;
  
  
  The accounting hole
&lt;/h2&gt;

&lt;p&gt;When nginx generates a response frame but cannot flush it to the socket immediately, it queues the frame on the connection and decrements the connection send window right away. Those bytes are spent from nginx's perspective, even though the client has not seen them yet. The commit message explains the failure precisely:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When a stream is terminated, its unsent payload length is refunded back to the connection flow control. Previously, this could increase the flow control beyond NGX_HTTP_V2_MAX_WINDOW, if it was increased by the client after the stream frames were queued and before the stream was terminated.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read that as an attack recipe. Open a stream and make nginx queue response frames, which charges the connection window. Then, as the client, send a WINDOW_UPDATE that legitimately raises the connection window, since the queued bytes are not counted as outstanding credit in the validation check. Finally, reset the stream. nginx refunds the unsent payload back into the connection window, and the refund stacks on top of credit the client already granted. Repeat, and the connection send window climbs past the 2 GiB ceiling that the protocol says can never be crossed.&lt;/p&gt;

&lt;p&gt;The consequences live in ngx_http_v2_send_chain(), where buffer size control depends on the window being honest. Once it is not, the commit says, the result is broken buffer size control followed by memory corruption and a possible segmentation fault. None of this requires authentication. The attacker needs only a TCP connection, a completed HTTP/2 preface, and the freedom to send WINDOW_UPDATE and RST_STREAM frames, all of which are unauthenticated by design.&lt;/p&gt;

&lt;p&gt;A detail worth noting for anyone reading the source: the stream-level send_window is a signed ssize_t, deliberately allowed to go negative, while the connection-level send_window is a size_t. Signedness choices around these counters are exactly where underflow and overflow bugs breed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The patch is one comparison and one counter
&lt;/h2&gt;

&lt;p&gt;The fix introduces a single new counter on the HTTP/2 connection object and subtracts it in exactly one validation. Frames that are queued still belong to the flow-control window from the client's point of view, so the validation must treat them as spent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt; struct ngx_http_v2_connection_s {
     ...
     size_t                           send_window;
&lt;span class="gi"&gt;+    size_t                           send_queued;&lt;/span&gt;
     size_t                           recv_window;
     ...
 };

&lt;span class="gd"&gt;-    if (window &amp;gt; NGX_HTTP_V2_MAX_WINDOW - h2c-&amp;gt;send_window) {&lt;/span&gt;
&lt;span class="gi"&gt;+    if (window &amp;gt; NGX_HTTP_V2_MAX_WINDOW - h2c-&amp;gt;send_window - h2c-&amp;gt;send_queued) {&lt;/span&gt;
         ngx_log_error(NGX_LOG_INFO, h2c-&amp;gt;connection-&amp;gt;log, 0,
                       "client violated connection flow control: "
                       "received WINDOW_UPDATE frame "
&lt;span class="gd"&gt;-                      "with window increment %uz not allowed for window %uz",&lt;/span&gt;
&lt;span class="gd"&gt;-                      window, h2c-&amp;gt;send_window);&lt;/span&gt;
&lt;span class="gi"&gt;+                      "with window increment %uz not allowed for window %uz",&lt;/span&gt;
&lt;span class="gi"&gt;+                      window, h2c-&amp;gt;send_window + h2c-&amp;gt;send_queued);&lt;/span&gt;
         return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_FLOW_CTRL_ERROR);
     }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The counter is maintained at the three places where the lifecycle of a queued frame changes. When a frame is queued in ngx_http_v2_send_chain(), the connection books those bytes as queued. When the frame is finally written out, the queued total drops by the frame length. And when a stream is torn down with frames still pending, the cleanup path subtracts the refunded window from the queued total so the refund cannot be counted twice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* frame queued in ngx_http_v2_send_chain() */&lt;/span&gt;
&lt;span class="n"&gt;h2c&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;send_window&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;frame_size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;h2c&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;send_queued&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;frame_size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/* frame actually sent, ngx_http_v2_data_frame_handler() */&lt;/span&gt;
&lt;span class="n"&gt;h2c&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;send_queued&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/* stream terminated with pending frames, ngx_http_v2_filter_cleanup() */&lt;/span&gt;
&lt;span class="n"&gt;h2c&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;send_window&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;window&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;h2c&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;send_queued&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;window&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The whole fix is a struct field plus three accounting lines and one changed comparison. Bugs with this ratio of damage to patch size are the ones that keep security teams employed.&lt;/p&gt;

&lt;h2&gt;
  
  
  From corrupt memory to a root shell
&lt;/h2&gt;

&lt;p&gt;The nginx commit conservatively stops at memory corruption and a possible segmentation fault. The researchers go further. Wiz characterizes the issue as pre-authentication remote code execution in HTTP/2 handling, and Xint's NGINX2Root page claims the chain runs from an unauthenticated visitor to root on the server host, with the five CVEs listed above covering the individual weaknesses in the chain.&lt;/p&gt;

&lt;p&gt;I have not reproduced the exploit, and neither the commit nor the public thread proves the full RCE chain end to end, so treat the escalation claims as the researchers' demonstrated results rather than something this article can independently confirm. What the public record does establish is the corruption primitive, in nginx's own words, plus the fact that five organizations considered it serious enough to coordinate disclosure.&lt;/p&gt;

&lt;p&gt;Even the conservative reading is bad. A pre-auth, remotely triggerable segmentation fault in the worker that holds every connection is a denial-of-service condition for anything behind that nginx instance. nginx fronts a large share of the public internet as a web server, reverse proxy, and TLS terminator, so the blast radius is measured in a noticeable fraction of all websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  The operator playbook
&lt;/h2&gt;

&lt;p&gt;The fixed versions are already out: mainline 1.31.9 and stable 1.30.7, both released on November 11. nginx's numbering makes the branch easy to read: an odd minor version is mainline, an even minor version is stable. Check what you run, then check what your package manager actually gives you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# installed version&lt;/span&gt;
nginx -v

&lt;span class="c"&gt;# which branch line you track: 1.31.x is mainline, 1.30.x is stable&lt;/span&gt;
&lt;span class="c"&gt;# fixed means 1.31.9+ on mainline or 1.30.7+ on stable&lt;/span&gt;

&lt;span class="c"&gt;# after upgrading the package, a reload is NOT enough&lt;/span&gt;
sudo systemctl restart nginx

&lt;span class="c"&gt;# confirm the running master started after the package install&lt;/span&gt;
sudo systemctl show nginx --property=ExecMainStartTimestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two traps deserve emphasis. First, the reload trap: nginx -s reload sends HUP to the running master, which re-reads configuration and forks fresh workers from the already-running master image. It does not load the new binary you just installed. Hosts can sit patched on disk and vulnerable in memory for weeks, which is exactly the failure mode one operator in the Hacker News thread warned about. Restart the service, then verify the master's start timestamp.&lt;/p&gt;

&lt;p&gt;Second, distribution lag. At the time of disclosure, commenters tracking the Ubuntu and Debian nginx packages reported both were still unpatched, while F5 had published advisory K000164058 for its commercially supported builds. If your distribution has not shipped the fix, the documented stopgap is to disable HTTP/2 until the package lands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="c1"&gt;# stopgap: remove the HTTP/2 code path until your distro ships the fix
&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;# no http2 parameter&lt;/span&gt;
    &lt;span class="c1"&gt;# on nginx 1.25.1+, also delete any: http2 on;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That costs you multiplexing and header compression, and it takes the vulnerable parser off the wire. For most sites it is a survivable performance regression; a pre-auth memory corruption bug is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why HTTP/2 keeps hurting nginx
&lt;/h2&gt;

&lt;p&gt;The thread reaction was blunt: it seems like it is always HTTP/2 with nginx, except when it is regex. That is sentiment, but the structural reason behind it is real. HTTP/2 turns a connection into a long-lived state machine where a handful of shared counters are mutated by asynchronous events from three directions: client frames arriving, upstream responses being generated, and streams being torn down. Flow control is the worst of these counters because it is both security-critical arithmetic and entirely attacker-influenced. The client chooses when to send WINDOW_UPDATE, when to reset, and how much payload to leave queued.&lt;/p&gt;

&lt;p&gt;HTTP/1.1 in nginx rarely produces this class of bug because there is almost no shared per-connection arithmetic to corrupt. That does not make HTTP/2 a mistake; the performance case for multiplexing is real, and the same RFC that defined the 31-bit ceiling also told implementers exactly what to enforce. The lesson is narrower and colder: any place where your code refunds, grants, or otherwise re-credits a resource is a place where the accounting has to be airtight, because the attacker controls the interleaving.&lt;/p&gt;

&lt;p&gt;The window to act is measured in days. The fix has been sitting in the public repository since November 11, which means every n-day differ has had a week of head start, and the patched releases predate the disclosure. If you run nginx with HTTP/2 enabled, the order of operations is unglamorous and non-negotiable: install 1.30.7 or 1.31.9 or newer, restart the master process rather than reloading it, verify the running binary actually changed, and only then consider yourself patched.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/pre-auth-rce-in-nginx-http-2-the-window-update-accounting-bug-five-teams-found-at-once" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>Rows vs Columns: The Cache-Line Math That Decides Your Database Layout</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Tue, 17 Nov 2026 17:28:38 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/rows-vs-columns-the-cache-line-math-that-decides-your-database-layout-5277</link>
      <guid>https://dev.to/chenyuan20509/rows-vs-columns-the-cache-line-math-that-decides-your-database-layout-5277</guid>
      <description>&lt;p&gt;A 48-byte record holds a 4-byte column you actually need. Reading that one column through a row-oriented layout pulls twelve times more bytes from memory than the query uses, because the CPU cannot fetch four bytes without fetching the 44 bytes sitting next to them. Multiply that by a hundred million rows and a layout choice you never thought about becomes the difference between scanning 4 gigabytes and scanning 48.&lt;/p&gt;

&lt;p&gt;That arithmetic, from a recent SpiralDB post that walked through it line by line, is the sharpest way to understand why the database world split in two. Postgres and MySQL store rows. DuckDB and ClickHouse store columns. Both answer the same SQL with the same results, yet the performance gap between them on the wrong workload is not a few percent — it is routinely an order of magnitude, and it comes from physics, not cleverness.&lt;/p&gt;

&lt;p&gt;This article rebuilds that gap from first principles: the memory layout, the execution model, and the compression tricks, then looks at the row store's surprisingly effective countermoves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two layouts, one logical table
&lt;/h2&gt;

&lt;p&gt;The first thing to understand is what does not change. Whether the engine stores rows or columns, &lt;code&gt;CREATE TABLE&lt;/code&gt; is the same SQL, &lt;code&gt;SELECT&lt;/code&gt; is the same SQL, and the answers are identical. Row versus column is a physical distinction, not a logical one.&lt;/p&gt;

&lt;p&gt;A row store keeps each record's values next to each other, exactly like a line in a CSV file or a struct in an array. A column store tears every record apart and keeps each column's values next to each other instead. Systems programmers will recognize this as the classic array-of-structs versus struct-of-arrays split, and that mapping is exact: a row store is an array of structs, a column store is a struct of arrays. The difference is that a database makes the choice about on-disk layout, where it interacts with compression and I/O, not just the CPU cache.&lt;/p&gt;

&lt;p&gt;The idea is older than its current popularity. The Decomposition Storage Model proposed storing each column separately in a SIGMOD paper back in 1985. What changed is the workload: analytics, where a query touches every row but only a few columns, became important enough to build entire systems around.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cache-line math that starts everything
&lt;/h2&gt;

&lt;p&gt;A CPU does not fetch memory one value at a time. It fetches fixed-size blocks called cache lines — 64 bytes on most server and desktop chips, 128 on Apple's M-series. If the value you want lives inside a line, you get the whole line whether you asked for it or not.&lt;/p&gt;

&lt;p&gt;Take a ride-sharing record with five fields: an ID, a timestamp, two strings, and a 4-byte duration. Laid out as a struct it occupies about 48 bytes. A query computing the average duration needs only those 4 bytes per record, but the row layout forces the hardware to fetch all 48 — twelve times the useful bytes — and because the record is smaller than a cache line, no line can be skipped. The column layout puts every duration in one contiguous array, so the same query reads exactly 4 bytes per record and nothing else.&lt;/p&gt;

&lt;p&gt;You can feel the shape of this in a few lines of Python. This is not a benchmark of your database — interpreter overhead dominates pure Python — but it shows the two memory layouts side by side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;rides_rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"area"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"soho"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"kind"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"classic"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"duration"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1_000_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"duration"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rides_rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# walks a million separate dicts&lt;/span&gt;

&lt;span class="n"&gt;durations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1_000_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# one contiguous array&lt;/span&gt;
&lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;durations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# tight loop over a single buffer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The row version walks a million separate objects and chases a pointer for every field. The column version walks one buffer. In a native engine, that difference is the 12x byte amplification above, plus the ability to skip every column the query never asked for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why column scans vectorize and row scans do not
&lt;/h2&gt;

&lt;p&gt;Storage is only the beginning. The execution model changes with it.&lt;/p&gt;

&lt;p&gt;A general-purpose engine plans every query from reusable operators — scan, filter, aggregate. In the classic Volcano model, operators pass one row at a time between them, so for every single row the engine re-dispatches to the next operator, re-checks which column it wants, and re-checks the type. That per-row bookkeeping can easily cost more than the arithmetic itself.&lt;/p&gt;

&lt;p&gt;A column store instead hands operators batches of a few thousand values — a common batch size is 1024. Bookkeeping is paid once per batch, and the batch is small enough to stay in the CPU cache until the next operator picks it up, so intermediate results never round-trip to main memory. The actual work collapses into a tight loop over a contiguous array.&lt;/p&gt;

&lt;p&gt;Tight loops over contiguous arrays are exactly what modern CPUs accelerate. With AVX-512, a single &lt;code&gt;vpaddq&lt;/code&gt; instruction adds eight 64-bit integers at once — eight lanes, each keeping its own running sum, combined only at the end. Compilers do this automatically: the SpiralDB post shows &lt;code&gt;rustc&lt;/code&gt; compiling a plain summation loop into AVX-512 code that also unrolls the loop four ways, so each pass processes 32 values. Nobody wrote a SIMD intrinsic. The layout made the loop simple enough that LLVM could vectorize it for free.&lt;/p&gt;

&lt;p&gt;Row layouts rarely get this treatment, because their loops chase pointers and touch heterogeneous fields — the two things SIMD hates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compression is where columns pull away
&lt;/h2&gt;

&lt;p&gt;Most query time is not compute; it is waiting for bytes from disk or object storage. Size is speed, and this is where columns gain their largest edge.&lt;/p&gt;

&lt;p&gt;The naive approach is black-box compression: zip each block. It works on everything but destroys random access — reading one value means decompressing everything before it. A database that must decompress a whole block to read one ride's duration has lost the game.&lt;/p&gt;

&lt;p&gt;Column values share a type and tend to resemble each other, so they support lightweight encodings: schemes that shrink data while keeping its structure and meaning. Two you can implement in twenty lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rle_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;delta_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;prev&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;prev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run-length encoding turns a column with two distinct values into pairs of value and repeat count. Delta encoding turns a steadily increasing ID column into small gaps, which then bit-pack into far fewer bits per value. Because the structure survives, the engine keeps random access — it can jump to the value it wants. Because the meaning survives, the engine can often filter and aggregate directly on encoded values without decoding them first, a technique called late materialization.&lt;/p&gt;

&lt;p&gt;Real systems stack these encodings. DuckDB applies lightweight compression per row group and made the &lt;code&gt;DICT_FSST&lt;/code&gt; string encoding the default in its v2.0.0 storage format. On-disk formats like Parquet split tables into row groups — an idea going back to the PAX paper from VLDB 2001 — and store each column separately inside the group, with per-block minimum and maximum statistics so queries can skip blocks entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  The row store's countermove
&lt;/h2&gt;

&lt;p&gt;None of this means row stores are helpless, and the Hacker News discussion of the SpiralDB piece surfaced the strongest counterargument immediately: a covering index. An index on exactly the columns a query needs lets the engine answer from the index alone, never touching the full rows. That is, in effect, a narrow columnar copy of part of the table, maintained by the row store for you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_rides_area_time&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;rides&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start_area&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;started_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- answered entirely from the index; the base table is never read&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;start_area&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;started_at&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;rides&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;start_area&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SoHo'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vendors pushed the idea much further. Sybase IQ ran column-oriented storage commercially in the 1990s. SQL Server added columnstore indexes in 2012, letting one table carry both layouts. Oracle's Database In-Memory option keeps a columnar mirror of row tables for analytics. And the boundary keeps blurring: CedarDB, the commercial version of the Umbra research system, runs transactions and analytics on one engine, while Databricks' Lakebase keeps Postgres for transactions and rewrites the same data into columnar form in the background.&lt;/p&gt;

&lt;p&gt;The honest conclusion from the classic SIGMOD 2008 study — titled, almost word for word, like the question this article asks — is that the layout explains most of the gap, but execution and compression techniques decide how much of that potential a system actually realizes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What columns give up
&lt;/h2&gt;

&lt;p&gt;The trade is real, and it is why the world did not simply switch. A point lookup that reads every field of one record touches one or two cache lines in a row store, but fans out to at least five separate arrays in a column store. Writes hurt more: inserting one record means appending to five different places, five I/O operations instead of one.&lt;/p&gt;

&lt;p&gt;The standard answer is as old as C-Store in 2005: keep a small write-optimized store beside the big read-optimized one and merge in the background. Modern columnar systems still work this way, buffering inserts and rewriting row groups in batches rather than updating columns in place. It works, but it is a fundamentally more complicated write path, and it is why your banking app still runs on a row store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing a layout, mechanically
&lt;/h2&gt;

&lt;p&gt;The decision procedure fits on an index card. If the workload reads and writes a few whole records at a time — logins, carts, payments — choose a row store. If it scans most of the data but only a few columns — dashboards, aggregations, model features — choose a column store. If you genuinely have both, reach for the hybrids: a covering index or columnstore index inside your row store, or an analytical engine reading columnar files produced from your transactional system.&lt;/p&gt;

&lt;p&gt;The one-step diagnostic is to look at your slowest queries and count what they touch. Rows touched times columns needed, divided by total columns, tells you how much of every fetched byte is useful work. When that fraction is small, the cache-line math from the beginning of this article is already taxing you, and no amount of query tuning on the wrong layout will give it back.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/rows-vs-columns-the-cache-line-math-that-decides-your-database-layout" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>PyPI Now Shows Provenance on Every Release: What the New Security States Actually Mean</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Sun, 15 Nov 2026 17:22:18 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/pypi-now-shows-provenance-on-every-release-what-the-new-security-states-actually-mean-2n30</link>
      <guid>https://dev.to/chenyuan20509/pypi-now-shows-provenance-on-every-release-what-the-new-security-states-actually-mean-2n30</guid>
      <description>&lt;p&gt;The most consequential change to installing Python packages this year is not in pip — it is a tab on a web page most people never open.&lt;/p&gt;

&lt;p&gt;On November 6, 2026, the PyPI team announced that its redesigned project pages are live, and the centerpiece is a dedicated security tab that grades every release's provenance: a cryptographic answer to the question "where did this file actually come from?" The data behind it has existed since November 2024, when PyPI finalized support for PEP 740 digital attestations. What changed this month is that the information stopped being an API curiosity and became a label you cannot miss.&lt;/p&gt;

&lt;p&gt;That matters because the classic supply-chain attack on PyPI is not a malicious package uploaded from scratch — it is a previously trustworthy package whose maintainer account or publishing pipeline gets taken over. Provenance states exist to catch exactly that scenario, and the new warnings are tuned to the specific ways a takeover shows up in release files. Here is what each state means, where the labels fall short, and how to check them without opening a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The blind spot between pip and the package page
&lt;/h2&gt;

&lt;p&gt;Since late 2024, PyPI has accepted signed attestations that bind each release file to an OIDC identity — typically a GitHub Actions workflow in a specific repository at a specific commit. Attestations are verified by PyPI at upload time, recorded in a transparency log, and exposed through an Integrity API. More than 20,000 attestations were published in the first weeks after launch, and the feature built directly on Trusted Publishing, which had already replaced long-lived API tokens with short-lived OIDC credentials for many projects.&lt;/p&gt;

&lt;p&gt;The problem was visibility. Attestations lived one click deep on per-file pages, and nothing on a project's main page told you whether a release had them. Users reasonably treated &lt;code&gt;pip install&lt;/code&gt; as a name lookup and never saw the difference between a wheel built by the project's own CI and a wheel uploaded by whoever happened to hold a token. PyPI's own announcement concedes the interface "did little to communicate their meaning, importance, or limitations."&lt;/p&gt;

&lt;p&gt;The redesign, funded by the Open Source Security Foundation, implemented by Kabu Creative, and shaped by the OpenSSF Attestations Style Guide, closes that gap by promoting provenance to a first-class signal on the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the new security tab shows
&lt;/h2&gt;

&lt;p&gt;The security tab computes one provenance state per release by checking every file in it. Two states cover most of what you will see.&lt;/p&gt;

&lt;p&gt;Full provenance means 100% of the release files carry attestations. Two attestation types count. A PyPI Publish attestation confirms the file was uploaded by a configured Trusted Publisher — an OIDC identity PyPI already trusts for that project. A SLSA Build Provenance attestation goes further and links the file back to its exact source commit, build platform, and build instructions. You can read the attestation metadata inline in the tab or follow the link into the transparency log entry.&lt;/p&gt;

&lt;p&gt;No provenance means no file in the release has an attestation. PyPI is careful about the interpretation: this is normal for older releases and for projects that never configured Trusted Publishing, and it does not indicate malice. It means the file's origin cannot be cryptographically verified, so your trust has to come from surrounding signals — maintainer history, release cadence, repository activity. The label describes the absence of evidence, not the presence of a threat.&lt;/p&gt;

&lt;h2&gt;
  
  
  The four provenance warnings
&lt;/h2&gt;

&lt;p&gt;The interesting states are the four warnings, because each maps to a recognizable failure mode.&lt;/p&gt;

&lt;p&gt;Incomplete provenance fires when some files in a release carry attestations and others do not — the canonical example is wheels published through Trusted Publishing while the source tarball was uploaded with an API token. PyPI's advice is to check release notes or ask in the issue tracker before installing.&lt;/p&gt;

&lt;p&gt;Inconsistent provenance means files within the same release trace back to different build systems or source repositories. The attestation metadata will show whether every file came from infrastructure the maintainers control.&lt;/p&gt;

&lt;p&gt;Change of provenance fires when a release's files originate from a different repository or workflow than the previous release. This one is deliberately noisy, because legitimate causes are common — an organization rename or a repository migration will trip it. It is also precisely what a compromised pipeline looks like, so PyPI asks you to confirm a planned migration through official channels before trusting the release.&lt;/p&gt;

&lt;p&gt;Loss of provenance means a project that previously published with attestations has stopped. Maybe the maintainers deliberately switched back to token uploads; maybe someone who took over the account could not reproduce the attested workflow. Until you know which, PyPI's guidance is to treat the release with skepticism.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why mixed uploads now raise a red flag
&lt;/h2&gt;

&lt;p&gt;There is an operational consequence buried in the incomplete-provenance rule that maintainers need to internalize: attestations are all-or-nothing per release. If your wheels go out through an attested Trusted Publisher workflow but your sdist still rides on a manual &lt;code&gt;twine upload&lt;/code&gt; with an API token, the release is flagged with a prominent warning — PyPI treats the mixture as a possible compromise indicator rather than partial credit.&lt;/p&gt;

&lt;p&gt;The fix is not to abandon attestations but to make the whole release flow through one attested path. In practice that means publishing with the official GitHub Action, which generates attestations by default when Trusted Publishing is configured, for every artifact of the release. If you inherit a project with a mixed history, expect warnings on the transition release and document the change in your release notes so users can tell the flag is expected.&lt;/p&gt;

&lt;h2&gt;
  
  
  What else changed on the project page
&lt;/h2&gt;

&lt;p&gt;The redesign reaches beyond the security tab. Provenance warnings now render as banners at the top of the project page, in the same tier as yanked-release, archived-project, and pre-release notices — with one explicit precedence rule: if a project or release is quarantined, only the quarantine banner shows, because it outranks everything else. When a release has full provenance or an active warning, its state appears in the sidebar and links through to the security tab.&lt;/p&gt;

&lt;p&gt;Metadata on the page is now ordered by utility and split into two honest labels: "PyPI data" for whatever the uploader asserted, and "Data verified by PyPI" for what the index actually checked. The release files tab gained search and filtering for long file lists, shows each file's provenance state inline, and marks "late files" — files uploaded more than 14 days after the release's initial timestamp — with an orange warning. The late-file badge only appears on releases predating July 2026, when PyPI began rejecting new files after that window outright. The release history tab now lists file count, provenance state, and release status per version, so a quarantined or yanked release is visible at a glance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking provenance without a browser
&lt;/h2&gt;

&lt;p&gt;Everything the tab displays is backed by the Integrity API that shipped with PEP 740, so you can wire the check into scripts and CI gates. The endpoint answers per file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_provenance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"https://pypi.org/integrity/{project}/{version}/{filename}/provenance"&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_provenance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"datasette"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0.65.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"datasette-0.65.5-py3-none-any.whl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# dict_keys(['attestation_bundles', 'version'])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A working check against a live response looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_provenance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"datasette"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0.65.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"datasette-0.65.5-py3-none-any.whl"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;bundles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"attestation_bundles"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;bundles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"no provenance: file origin is not cryptographically verified"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;bundle&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;bundles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;publisher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;bundle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"publisher"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"kind"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"repository"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"workflow"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"environment"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To audit every file of a release — the same sweep the security tab performs — combine it with the JSON metadata API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;release_provenance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"https://pypi.org/pypi/{project}/{version}/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"urls"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_provenance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"filename"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"filename"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"attestation_bundles"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"filename"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;attested&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"full"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;attested&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"none"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;attested&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"incomplete"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The state this prints is the same full / none / incomplete classification the UI shows, so a dependency-review job can fail a build on the exact condition the web page would warn about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting your own project to full provenance
&lt;/h2&gt;

&lt;p&gt;If you maintain a package, the path to a green security tab runs through Trusted Publishing. Register your CI as a publisher in the project's PyPI settings, then publish with the official action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
  &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;release&lt;/span&gt;
  &lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;id-token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
  &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/download-artifact@v4&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pypa/gh-action-pypi-publish@release/v1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;id-token: write&lt;/code&gt; and no stored API token, the action exchanges the workflow's OIDC identity for a short-lived upload credential and generates the PyPI Publish attestation automatically; SLSA build provenance follows when the build itself is attested. Two caveats are worth planning around. Trusted publishers are currently the major hosted CI providers, which is a real centralization trade-off for projects building on their own hardware. And remember the all-or-nothing rule: once any file in a release is attested, every file should be, or the release gets flagged as incomplete.&lt;/p&gt;

&lt;h2&gt;
  
  
  What these signals cannot tell you
&lt;/h2&gt;

&lt;p&gt;Provenance answers "where did this file come from," not "is this file good." A brand-new package published through a perfectly attested workflow can still be malware; the system is designed to catch the takeover of a previously benign project's publishing path, and it does that well, but it says nothing about first-party malice. The labels also live on the website: pip does not surface provenance during install, so the check only helps people and tooling that actually consult it — which is an argument for the Integrity API pattern above rather than for eyeballing project pages. Finally, availability limits adoption: until more CI platforms can act as trusted publishers, full provenance will cluster on projects hosted by the largest providers, and a "no provenance" badge will often mean "small project on self-hosted CI" rather than anything suspicious.&lt;/p&gt;

&lt;p&gt;None of that diminishes what shipped. PyPI took a verification system that already existed, made its states legible, and attached warnings calibrated to the real anatomy of account takeovers. The next time a dependency releases from an unexpected repository, the warning will be sitting at the top of the page — the remaining work is on the consumer side: look, or better, script the lookup so you cannot forget to look.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/pypi-now-shows-provenance-on-every-release-what-the-new-security-states-actually-mean" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>Rust 1.100 Is the Biggest Release in Years: Never Type, Custom Allocators, and Dependency Cooldowns</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Fri, 13 Nov 2026 17:22:21 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/rust-1100-is-the-biggest-release-in-years-never-type-custom-allocators-and-dependency-cooldowns-2on2</link>
      <guid>https://dev.to/chenyuan20509/rust-1100-is-the-biggest-release-in-years-never-type-custom-allocators-and-dependency-cooldowns-2on2</guid>
      <description>&lt;p&gt;How long should it take to stabilize one type in a programming language? If the type is Rust's never type, the honest answer turned out to be ten years and five failed stabilization attempts. Rust 1.100.0, released on November 12, 2026, finally lands it — and that is not even the most operationally important change in the release. The same version stabilizes the core of the allocator API so &lt;code&gt;Vec&lt;/code&gt; and &lt;code&gt;Box&lt;/code&gt; can finally use custom allocators on stable, adds a &lt;code&gt;DropGuard&lt;/code&gt; helper that makes rollback-style code a three-line pattern, warns you about dependencies you no longer use, reorganizes Cargo's build directory, and introduces dependency cooldowns that make the resolver ignore freshly published crate versions until they have survived a waiting window you choose.&lt;/p&gt;

&lt;p&gt;That is an unusual amount of substance for one release. This article walks through each change with the code you would actually write, flags the one deliberate breaking change, and ends with a practical answer to the upgrade question.&lt;/p&gt;

&lt;h2&gt;
  
  
  The never type, ten years and five attempts later
&lt;/h2&gt;

&lt;p&gt;The never type, spelled &lt;code&gt;!&lt;/code&gt;, is Rust's canonical uninhabited type: the type of computations that never produce a value. Expressions that permanently divert control flow — &lt;code&gt;return&lt;/code&gt;, &lt;code&gt;break&lt;/code&gt;, &lt;code&gt;std::process::exit&lt;/code&gt; — have type &lt;code&gt;!&lt;/code&gt;, and because no value of type &lt;code&gt;!&lt;/code&gt; can exist, Rust allows a never-to-any coercion that turns &lt;code&gt;!&lt;/code&gt; into whatever type the surrounding context needs. That coercion is why a &lt;code&gt;match&lt;/code&gt; arm ending in &lt;code&gt;return&lt;/code&gt; type-checks next to arms that produce real values.&lt;/p&gt;

&lt;p&gt;You could observe &lt;code&gt;!&lt;/code&gt; before, and even write it in a function return position (&lt;code&gt;-&amp;gt; !&lt;/code&gt;). What 1.100 adds is the ability to name it anywhere a type goes, which makes previously impossible signatures expressible:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;infallible_unwrap&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;!&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;T&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Writing `Result&amp;lt;_, !&amp;gt;` was not allowed before 1.100.&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="kc"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;Result&amp;lt;T, !&amp;gt;&lt;/code&gt; is a result that cannot fail, and the function above unwraps it without a panic path, a dummy error case, or an &lt;code&gt;unsafe&lt;/code&gt; block. The compiler accepts the irrefutable &lt;code&gt;let Ok(v)&lt;/code&gt; pattern because it can prove the &lt;code&gt;Err&lt;/code&gt; variant is uninhabited.&lt;/p&gt;

&lt;p&gt;Two deeper changes ride along. First, &lt;code&gt;std::convert::Infallible&lt;/code&gt; is now an alias for &lt;code&gt;!&lt;/code&gt;, so every old API written against &lt;code&gt;Infallible&lt;/code&gt; is automatically compatible with the never type — this was the plan from the start, and untangling it is a large part of why stabilization took five attempts. Second, the release changes "never type fallback" from &lt;code&gt;()&lt;/code&gt; to &lt;code&gt;!&lt;/code&gt; in editions 2015, 2018, and 2021, matching what edition 2024 already does. That is a deliberate breaking change. The team shipped future-compatibility warnings well in advance and fixed affected public crates, but the fallout is real if rare: code that ignores the result of a generic function can change meaning, and the compiler may now flag more code as unreachable. If a dependency fails to build after upgrading, check for a newer release of that dependency before doing anything else — the fix probably exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom allocators you can actually use
&lt;/h2&gt;

&lt;p&gt;The second headline is the stabilization of the core of &lt;code&gt;allocator_api&lt;/code&gt;: the &lt;code&gt;std::alloc::Allocator&lt;/code&gt; trait, plus the &lt;code&gt;Global&lt;/code&gt; and &lt;code&gt;System&lt;/code&gt; allocator types. The practical consequence is that &lt;code&gt;Vec&lt;/code&gt; and &lt;code&gt;Box&lt;/code&gt; now have &lt;code&gt;_in&lt;/code&gt; constructors on stable Rust — &lt;code&gt;Vec::new_in&lt;/code&gt;, &lt;code&gt;Vec::with_capacity_in&lt;/code&gt;, &lt;code&gt;Box::new_in&lt;/code&gt;, &lt;code&gt;Box::from_raw_in&lt;/code&gt;, and the matching accessors like &lt;code&gt;Vec::allocator&lt;/code&gt; and &lt;code&gt;Box::into_raw_with_allocator&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;alloc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Allocator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Global&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Layout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;AllocError&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;NonNull&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;Counting&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;unsafe&lt;/span&gt; &lt;span class="k"&gt;impl&lt;/span&gt; &lt;span class="nc"&gt;Allocator&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nc"&gt;Counting&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;allocate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Layout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NonNull&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;AllocError&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Global&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allocate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nf"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"allocated {} bytes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kc"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;unsafe&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;deallocate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;NonNull&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;u8&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Layout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"freed {} bytes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;unsafe&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Global&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deallocate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;u32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Counting&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new_in&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Counting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// allocation goes through your code&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the foundation of the "Allocators 1.0" project goal, and the release notes are explicit that the job is not finished: more collections and pointer types still need &lt;code&gt;_in&lt;/code&gt; variants. But the hard part — the trait and its object-safety design — is done. Arena allocation, per-request memory budgets in servers, and embedded allocators no longer require nightly. The community noticed immediately: one Hacker News commenter described spending days working around arena leaks with the third-party &lt;code&gt;allocator-api2&lt;/code&gt; shim and being able to delete that workaround now that &lt;code&gt;Vec::new_in&lt;/code&gt; is stable.&lt;/p&gt;

&lt;h2&gt;
  
  
  DropGuard: rollback without a wrapper type
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Drop&lt;/code&gt; already guarantees that code runs when a value goes out of scope, whether the exit is a return, a &lt;code&gt;?&lt;/code&gt;, or a panic. But writing a whole struct with a &lt;code&gt;Drop&lt;/code&gt; impl just to run one closure is friction, so Rust 1.100 stabilizes &lt;code&gt;core::mem::DropGuard&lt;/code&gt;: a helper that wraps a variable and a closure, derefs to the variable so you can keep using it, and runs the closure — consuming the variable — when dropped. Its &lt;code&gt;dismiss&lt;/code&gt; method defuses the guard and hands the variable back, which makes all-or-nothing, transaction-shaped APIs a small, local pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;DropGuard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;ParseIntError&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;/// Push every parsed string into `nums`, or leave `nums` untouched.&lt;/span&gt;
&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;parse_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="kt"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;u32&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ParseIntError&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DropGuard&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;move&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;truncate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// reset on failure&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;strings&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// an early `?` triggers the rollback&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nc"&gt;DropGuard&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;dismiss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// success: keep the changes&lt;/span&gt;
    &lt;span class="kc"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before this, the same guarantee required either a bespoke guard type per call site or carefully ordered cleanup code on every error path. The guard version states the rollback once, next to the data it protects.&lt;/p&gt;

&lt;h2&gt;
  
  
  conjure_zst and the rules of zero-sized types
&lt;/h2&gt;

&lt;p&gt;The strangest addition is a single unsafe function: &lt;code&gt;std::mem::conjure_zst&lt;/code&gt;. It creates a value of a zero-sized type out of thin air, replacing the folk incantations people used before — transmuting &lt;code&gt;()&lt;/code&gt;, or &lt;code&gt;MaybeUninit::uninit().assume_init()&lt;/code&gt;. The reasoning is subtle: if a type has no size and is inhabited, there is exactly one bit pattern it can have, so materializing it is well-defined. The function is unsafe because APIs routinely rely on such types being impossible to construct. The release notes give a concrete example: PyO3's &lt;code&gt;Python&amp;lt;'py&amp;gt;&lt;/code&gt; is a zero-sized token witnessing that the caller holds the Python GIL, and conjuring one would let safe PyO3 calls run without the lock. Reach for &lt;code&gt;conjure_zst&lt;/code&gt; when you control the type's invariants; never to bypass someone else's.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cargo now warns about unused dependencies
&lt;/h2&gt;

&lt;p&gt;Cargo gained a real linting system, configured through a &lt;code&gt;[lints.cargo]&lt;/code&gt; table in &lt;code&gt;Cargo.toml&lt;/code&gt;, and its first user-facing lint is on by default: unused dependency reporting. A build now emits warnings like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;warning: unused dependency `tracing-subscriber`
  --&amp;gt; Cargo.toml:23:1
   |
23 | tracing-subscriber.workspace = true
   | ^^^^^^^^^^^^^^^^^^
   |
   = note: `cargo::unused_dependencies` is set to `warn` by default
help: consider removing the dependency on `tracing-subscriber`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The existing rustc lint &lt;code&gt;unused_crate_dependencies&lt;/code&gt; could not do this accurately, because Cargo shares dependency entries across every build target in a package — a crate used by one binary but not another would trigger false positives. The Cargo-level implementation understands target structure. Two limitations matter in practice: the warning only appears when you build every target that could use an entry (a bare &lt;code&gt;cargo check --bin foo&lt;/code&gt; stays quiet about shared &lt;code&gt;[dependencies]&lt;/code&gt;, because another bin might use them), and dev-dependencies are never flagged, since there is no way to guarantee every development target got built. Even with those caveats, this deletes a whole category of CI scripts and manual audits.&lt;/p&gt;

&lt;h2&gt;
  
  
  The build directory changed underneath you
&lt;/h2&gt;

&lt;p&gt;Cargo builds intermediates in a build directory and lifts final artifacts into the target directory, keeping configurations apart with a build-configuration hash. That hash was not always applied, because of platform constraints, which produced extra rebuilds, missed rebuilds, and genuine confusion when a build directory was shared across git worktrees. In 1.100 the layout is reorganized around the build step rather than the file type, and the hash moves from the file name into the parent directory, so it applies consistently.&lt;/p&gt;

&lt;p&gt;This is the stabilized output of the build-directory-layout project goal started in 2025, and it exists to unblock cache garbage collection, cross-workspace cache deduplication, and finer-grained locking. It is an internal change, but the release notes warn plainly that it may break build scripts and tests that encoded workarounds for the old behavior — in many cases the right fix is deleting the workaround. Cargo issue 17287 collects migration notes and new use cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dependency cooldowns: make fresh releases wait
&lt;/h2&gt;

&lt;p&gt;The supply-chain feature of the release is minimum publish age, from RFC 3923. Malicious crate versions are usually caught by scanners or the community within hours or days of publication. Cooldowns let you refuse to be the early adopter of a compromised release. Opt in once, in &lt;code&gt;.cargo/config.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[registry]&lt;/span&gt;
&lt;span class="na"&gt;global-min-publish-age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"3 days"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From then on, version resolution skips anything published more recently than the window, and tells you what it held back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     Locking 2 packages to highest compatible version as of min-publish-age
      Adding cc v1.11.0 (available: v1.18.0, published 3 hours ago)
      Adding clap 4.6.7 (available: 4.6.9, published 2 days ago)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you genuinely need the new version now, override for a single update with &lt;code&gt;CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE=allow cargo update clap --precise 4.6.9&lt;/code&gt;; the newer version is then recorded in &lt;code&gt;Cargo.lock&lt;/code&gt; and kept until a later re-resolve. Three sharp edges are documented: the mechanism depends on the registry recording publication times, and versions without a &lt;code&gt;pubtime&lt;/code&gt; field in the index are never held back; &lt;code&gt;cargo install&lt;/code&gt; ignores the minimum age entirely, for the installed crate and its dependencies, so pin with &lt;code&gt;cargo install foo@1.2.3&lt;/code&gt; when it matters; and cooldowns reduce supply-chain risk without being a complete defense — review updates as before. Quarantine support and automated detection of suspicious releases are planned under the crates.io supply-chain hardening goal.&lt;/p&gt;

&lt;h2&gt;
  
  
  The quiet API stabilizations worth knowing
&lt;/h2&gt;

&lt;p&gt;Beyond the headlines, the stabilized API list has several small tools that remove daily friction. &lt;code&gt;bool::toggle&lt;/code&gt; flips a flag in place. &lt;code&gt;Box::map&lt;/code&gt;, &lt;code&gt;Rc::map&lt;/code&gt;, and &lt;code&gt;Arc::map&lt;/code&gt; transform the inner value while preserving the allocation. &lt;code&gt;str::trim_prefix&lt;/code&gt;, &lt;code&gt;str::trim_suffix&lt;/code&gt;, their slice equivalents, and &lt;code&gt;Path::trim_prefix&lt;/code&gt; return the remainder without the &lt;code&gt;strip_prefix&lt;/code&gt; Option dance when you only want best-effort trimming. &lt;code&gt;Vec::from_fn&lt;/code&gt; builds a vector from an index-based closure. &lt;code&gt;Child::main_thread_handle&lt;/code&gt; exposes the handle of a spawned process's main thread, &lt;code&gt;Once&lt;/code&gt; gets a &lt;code&gt;Default&lt;/code&gt; impl, &lt;code&gt;UnsafeCell&lt;/code&gt; gains &lt;code&gt;replace&lt;/code&gt; and unchecked reference accessors, and on Windows &lt;code&gt;CommandExt::show_window&lt;/code&gt; controls console window visibility for spawned processes. Individually minor; together they delete a lot of utility code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should you upgrade today?
&lt;/h2&gt;

&lt;p&gt;Upgrading is one &lt;code&gt;rustup update stable&lt;/code&gt; away, and for most projects the answer is yes, with two checks first. Scan your CI for anything that pokes at the target directory layout or papers over the old hash behavior, because that is the change most likely to break a build that "worked by accident". Then watch the first build for new unreachable-code warnings and dependency compile errors, the visible symptoms of the never-type fallback change; the fix is almost always updating the affected crate. What you get in return is a type ten years in the making, stable custom allocators, a rollback primitive, a leaner dependency list, and a resolver that can wait out the window in which supply-chain attacks get caught. Few releases earn their minor version bump this thoroughly.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/rust-1-100-is-the-biggest-release-in-years-never-type-custom-allocators-and-dependency-cooldowns" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>Jane Street Shipped One Markdown File That Turns Any LLM Into a Strict Socratic Tutor</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Thu, 12 Nov 2026 17:19:29 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/jane-street-shipped-one-markdown-file-that-turns-any-llm-into-a-strict-socratic-tutor-32i9</link>
      <guid>https://dev.to/chenyuan20509/jane-street-shipped-one-markdown-file-that-turns-any-llm-into-a-strict-socratic-tutor-32i9</guid>
      <description>&lt;p&gt;Some time around 385 BC, Plato wrote a scene into the &lt;em&gt;Meno&lt;/em&gt; that teachers still cite. Socrates calls over a slave boy who has never studied geometry and draws a square in the dust. How would you make a square with double the area? The boy answers instantly: double the sides. Socrates draws it, and the boy sees for himself that the new square holds four times the area, not two. He guesses again, and fails again. Then, question by question — never a lecture — Socrates walks him to the real construction: build the new square on the diagonal of the old one. No formula was handed over. The boy produced every step himself, out loud, under pressure, and could defend it.&lt;/p&gt;

&lt;p&gt;That scene is the design document for what Jane Street published on GitHub this month: a repository named &lt;code&gt;agent_skills&lt;/code&gt; containing exactly one file that matters, a &lt;code&gt;SKILL.md&lt;/code&gt; that turns any modern LLM into the Socrates from that dialogue — a tutor that asks one question at a time, refuses to lecture, tracks what you have actually mastered on a six-level scale, and will lower your score without warning if a review question exposes that you never really learned something.&lt;/p&gt;

&lt;p&gt;The repository was created on November 3, 2026, and within ten days it had collected more than 7,400 stars and over 490 forks. It contains six files in total, one of which is &lt;code&gt;.ocamlformat&lt;/code&gt;, the configuration for the OCaml code formatter — about as pure a Jane Street fingerprint as a license header. Everything else is a license, a README, a contributing note, and the skill itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a skill is, mechanically
&lt;/h2&gt;

&lt;p&gt;A SKILL.md is a markdown file with a YAML frontmatter header that agentic tools load as an instruction pack. Claude Code made the format common: the model reads the file, and the file tells the model how to behave for a class of tasks. There is no executable code in it. Jane Street's README describes two ways to use their tutor: copy the &lt;code&gt;socratic-tutor&lt;/code&gt; directory into your agent's skills folder and ask "teach me X", or paste the body of the file into any plain chatbot as a system prompt.&lt;/p&gt;

&lt;p&gt;Which means the entire artifact is prose. Everything interesting about it lives in the writing, and the writing rewards a close read.&lt;/p&gt;

&lt;h2&gt;
  
  
  The frontmatter knows when not to run
&lt;/h2&gt;

&lt;p&gt;The file's first engineering decision sits in the YAML header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"socratic-tutor"&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Structured Socratic tutoring when the user explicitly asks to be taught, quizzed, or drilled to mastery on a topic: diagnostic placement, a skill map with levels 0-5, spaced review, and a final assessment. Trigger phrases: 'teach me', 'tutor me', 'quiz me', 'drill me', 'help me master'. Not for one-off 'explain X' or 'what is X' questions."&lt;/span&gt;
&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read that description as a routing rule, because that is what it is. Agents match incoming requests against skill descriptions, and this one spends half of its length on a negative clause: not for one-off questions. A skill that triggers too eagerly is worse than one that never triggers, and the author clearly knew it. The description names exact trigger phrases so the router has something concrete to match, and it names the excluded cases so "explain recursion" at 11pm does not accidentally turn into a forty-minute diagnostic with a progress bar.&lt;/p&gt;

&lt;h2&gt;
  
  
  The guard clause is a cost calculation
&lt;/h2&gt;

&lt;p&gt;The file's second decision repeats the same idea inside the body. If intent is ambiguous, the agent must ask exactly one question — "Want a quick answer, or should I actually teach you this properly?" — before starting anything. The reasoning written into the file is explicit about the asymmetry: a false start costs the user an unwanted quiz; a confirmation costs one word.&lt;/p&gt;

&lt;p&gt;That is a genuinely reusable rule for any agent behavior with an expensive happy path. Estimate the cost of a false positive against the cost of a confirmation gate, and when the ratio is this lopsided, write the gate into the procedure rather than hoping the model exercises judgment at runtime. Judgment is exactly what fails under a vague prompt; a written gate does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The skill map is state, and state is the hard part
&lt;/h2&gt;

&lt;p&gt;LLM sessions are stateless in every way that matters for teaching: the model does not remember Tuesday, does not know what you got wrong last week, and will happily re-explain the same concept forever. The tutor's answer is to externalize the state into the conversation itself. The topic gets broken into four to ten subskills, each tracked at a level from 0 (unaware) to 5 (can teach it), and the model re-renders the map in ASCII after every level change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Topic: &amp;lt;topic&amp;gt;                          overall: ######.... 58%
-----------------------------------------------------------------
subskill A            [########..]  4/5  * independent
subskill B            [######....]  3/5  &amp;lt;- current focus
subskill C            [##........]  1/5
-----------------------------------------------------------------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two user commands complete the design. "save state" makes the agent emit a compact block holding the topic, the map, and notes on your observed misconceptions; "resume from:" followed by that block restores the course in a brand-new session. The student, not the platform, carries the transcript. This is the same trick the better agent harnesses use for long-running work — when the runtime forgets, make the runtime's own output be the checkpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  The teaching loop is mostly a list of prohibitions
&lt;/h2&gt;

&lt;p&gt;The core loop is short: ask one question, end the message immediately after it, and wait for the answer. What fills the file is everything the tutor must not do. No hints after the question. No example answers appended just in case. When you are wrong, the tutor does not correct you — it asks a narrower question that exposes the contradiction inside your own reasoning, and only explains directly after two or three failed attempts, immediately re-testing the same idea from a different angle. When you are right, it will sometimes argue with you anyway, because an answer you cannot defend under pressure is not yet knowledge.&lt;/p&gt;

&lt;p&gt;Anyone who has used a chatbot for study recognizes what these rules are fighting. Left alone, models flatter, hint, and collapse into lecturing the moment the user hesitates. The skill reads like a list of observed model failure modes with a countermeasure bolted onto each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluation is where tutoring prompts usually die
&lt;/h2&gt;

&lt;p&gt;The strictest section of the file is the one on earning levels:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Levels are earned, not given. Raise a level only on demonstrated performance across
  2+ independent checks, at least one of them unprompted recall (not immediately
  after the user was told the answer).
- A vague or partially-correct answer is not correct. Probe until you know whether
  the user actually understands. Do not attribute to the user any insight they did
  not actually express.
- Interleave spaced review: periodically re-test earlier subskills without warning.
  If the user fails a review, lower the level and revisit.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three ideas in that block come from learning science rather than prompt folklore: recognition is not recall, hence the unprompted check; spacing beats massing, hence the unannounced review; and progress must be reversible, hence levels that go down. The file even bans flattery by name — "Not quite — why would X happen if Y were true?" beats "Great try!" Level 5 is reserved for a student who handles an adversarial edge case and then explains the concept clearly enough that the tutor would trust them to teach it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running it takes two minutes
&lt;/h2&gt;

&lt;p&gt;With a skill-aware agent, installation is a directory copy into the skills folder. With anything else, paste the file body into the chat and say "teach me Bayesian inference," or whatever you are actually working on. A session opens with the diagnostic — three to five probing questions spanning easy to hard, per subskill — and only after placement does the first lesson begin. Mid-course, the escape hatches are explicit: "just tell me" suspends Socratic mode for a single question, "harder" and "easier" retune the difficulty, and "show progress" redraws the map.&lt;/p&gt;

&lt;p&gt;The course ends only when every subskill reaches the target level — 4 out of 5 by default, 5 if you asked for full mastery — followed by a final mixed assessment with at least one question per subskill and one integrative problem. Fail it, and you go back into the loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Hacker News thread got right
&lt;/h2&gt;

&lt;p&gt;The front-page discussion, at 539 points when this article was researched, split into three camps, and all three teach something. The skeptics called it a prompt with a README, which is technically true and mostly beside the point — the value of the file is that a serious firm wrote down a hundred lines of teaching discipline so you do not have to rediscover them yourself. One commenter reduced the entire effect to a single sentence — "when the user is wrong, do not give the answer" — which is fair as far as it goes and misses the diagnostic, the state tracking, and the review schedule that make the effect hold across sessions instead of one afternoon.&lt;/p&gt;

&lt;p&gt;Another commenter pointed to an earlier community skill, &lt;code&gt;bevibing/socrates-skill&lt;/code&gt;, published back in April 2026 with a few hundred stars, doing the same job for Claude Code. Jane Street's contribution is packaging and distribution, not invention, and the star count says more about the firm's brand gravity than about novelty. The most useful comment in the thread was the weariest one: skills written for a model six months ago are already bit-rotting, because the newer model does much of it natively. That risk applies to every skill file in every repository, including this one, and it is the honest counterweight to the current excitement around the format.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pattern worth stealing
&lt;/h2&gt;

&lt;p&gt;Strip the pedagogy away and the file is a template for any behavior you want from a stateless model: a routing header that says when not to run, a cheap confirmation gate placed before an expensive procedure, state externalized into artifacts the user can carry between sessions, a loop defined by its prohibitions, and an evaluation section that treats progress as revocable. The next skill you write — for code review, for incident triage, for anything with levels of competence — can reuse all five parts unchanged.&lt;/p&gt;

&lt;p&gt;The slave boy in the &lt;em&gt;Meno&lt;/em&gt; walked away able to double a square. Jane Street's bet, written into a hundred lines of markdown, is that the method scales better than the lecture ever did.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/jane-street-shipped-one-markdown-file-that-turns-any-llm-into-a-strict-socratic-tutor" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>AWS's Official Emulator vs LocalStack: 160 Rust Crates, Fidelity Scores per Release, and a Telemetry Default</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Thu, 12 Nov 2026 00:40:25 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/awss-official-emulator-vs-localstack-160-rust-crates-fidelity-scores-per-release-and-a-2jk5</link>
      <guid>https://dev.to/chenyuan20509/awss-official-emulator-vs-localstack-160-rust-crates-fidelity-scores-per-release-and-a-2jk5</guid>
      <description>&lt;p&gt;The most widely used local AWS stack on GitHub was never made by AWS. LocalStack, a Python project created in October 2016, has collected 65,119 stars by pretending to be a cloud on a laptop. This month, AWS finally answered with its own entry: &lt;code&gt;aws/aws-emulator&lt;/code&gt;, a Rust workspace created on September 11, 2026, that was already at version 1.0.322 by November 11. It passed 1,700 stars within days of surfacing, hit the Hacker News front page with 618 points and more than two hundred comments, and immediately raised the only question that matters for a working engineer: does an official emulator change how you test cloud code, or is it a decade too late?&lt;/p&gt;

&lt;p&gt;This article reads the repository, the README, the release notes, and the project's own gap tracker, then compares what AWS built against the incumbent on the axes that decide a real adoption: architecture, packaging, fidelity disclosure, and cost. Everything below comes from the project's public artifacts, not from a press release.&lt;/p&gt;

&lt;h2&gt;
  
  
  What AWS actually shipped
&lt;/h2&gt;

&lt;p&gt;AWS Emulator is a local program that serves AWS API endpoints. It has no graphical interface. You start it, point the AWS CLI or an SDK at its endpoint through environment variables, and run your code as usual. Requests never leave your machine, you need no AWS account, and AWS charges nothing for it — you pay only when you deploy to real AWS.&lt;/p&gt;

&lt;p&gt;The repository metadata tells its own story. The workspace is written in Rust, licensed CC0-1.0 (public domain dedication, with the &lt;code&gt;vendor/&lt;/code&gt; directory under Apache-2.0), and holds one crate per AWS service — 160 service crates at the time of writing. The router binary mounts every service on a single HTTPS endpoint at 127.0.0.1:9297 with a self-signed certificate.&lt;/p&gt;

&lt;p&gt;Two boundaries are stated up front and worth taking seriously. The emulator is for building and testing only: AWS says not to use it for production workloads, and not to use it to test security. An emulator that accepts a request is not evidence that real IAM would.&lt;/p&gt;

&lt;h2&gt;
  
  
  One crate per service, driven by Smithy
&lt;/h2&gt;

&lt;p&gt;The repository layout is the architectural bet. Each service lives in &lt;code&gt;services/service-&amp;lt;name&amp;gt;/&lt;/code&gt; with a &lt;code&gt;smithy-model/&amp;lt;name&amp;gt;.json&lt;/code&gt; file — the Smithy model that drives the wire protocol — a &lt;code&gt;build.rs&lt;/code&gt; that generates the service declaration from that model, a &lt;code&gt;service.rs&lt;/code&gt; for request routing and refusal overrides, a &lt;code&gt;state.rs&lt;/code&gt; holding that service's in-memory state, and an &lt;code&gt;ops/&lt;/code&gt; directory with one file per operation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services/
└── service-&amp;lt;name&amp;gt;/          # one crate per service
    ├── smithy-model/        # the Smithy model that drives the wire protocol
    ├── build.rs             # generates the service declaration
    └── src/
        ├── service.rs       # routing and refusal overrides
        ├── state.rs         # in-memory state
        └── ops/             # one file per operation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That shape matters because it turns fidelity into a generation problem instead of a hand-coding problem. The wire format, the error shapes, and the refusal cases come from the same models AWS publishes for its real APIs, and the handwritten part is concentrated where emulators actually diverge: state transitions and validation order. When the emulator cannot honor a request, the codebase has a named concept for it — a refusal — rather than a shrug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two ways to run it
&lt;/h2&gt;

&lt;p&gt;Server mode is the familiar shape. On Linux you install the RPM or Debian package and run &lt;code&gt;aws-emulator&lt;/code&gt;. On Windows and macOS you run it in a container built from a short Dockerfile. Then you point your tools at it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# server mode: start the emulator, then aim the CLI at it&lt;/span&gt;
aws-emulator
aws --endpoint-url https://127.0.0.1:9297 dynamodb list-tables
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Embedded mode is the more interesting one for Rust teams. You add the emulator as a dev-dependency, and each test gets its own isolated in-process instance. There is no endpoint URL, no certificate, and no environment variable to manage; the test wires the emulator's HTTP client straight into the SDK client.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;aws_emulator_embedded&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;AwsEmulatorEmbedded&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;EmbeddedOptions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Telemetry&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;emulator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AwsEmulatorEmbedded&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nc"&gt;EmbeddedOptions&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;telemetry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Telemetry&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Off&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;_http_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;emulator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;http_client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The trade-off is build cost. Embedded mode compiles the emulator's service crates into your test binary, and the README is blunt about the numbers: a full source build wants Linux on x86_64 or aarch64, a C compiler alongside Cargo, and at least 100 GB of free disk for &lt;code&gt;target/&lt;/code&gt;. The project recommends reusing one &lt;code&gt;CARGO_TARGET_DIR&lt;/code&gt; across projects, caching &lt;code&gt;target/&lt;/code&gt; or using sccache in CI, and pinning the emulator to a release commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fidelity is the product
&lt;/h2&gt;

&lt;p&gt;Every emulator promises compatibility. This one publishes its own divergence ledger. The repository's &lt;code&gt;issues/&lt;/code&gt; directory holds 6,545 tracked files under &lt;code&gt;things-that-do-not-work/&lt;/code&gt; — one file per known gap, named with a timestamp and a plain description like &lt;code&gt;cloudfront-createdistribution-accepts-configurations-aws-rejects&lt;/code&gt; — and moves each one to &lt;code&gt;things-that-now-work/&lt;/code&gt; when it is fixed. Every release ships a single asset, &lt;code&gt;scores.json.gz&lt;/code&gt;, a little over a megabyte of per-service fidelity scores.&lt;/p&gt;

&lt;p&gt;The release cadence backs the ledger up. Version 1.0.292 and 1.0.293 both shipped on November 10, and 1.0.322 followed on November 11. The release notes are not feature announcements; they are lists of fidelity fixes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- fix: cognito-idp-getuser-refuses-a-revoked-access-token
- fix: cloudformation-stack-outputs-are-unusable-and-create-complete
- fix: cloudwatch-logs-sns-sqs-metric-filter-driven-alarm-chain
- fix: ec2-refuses-valid-requests-on-implemented-operations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This inverts the usual relationship with an emulator. Instead of discovering a divergence when your test passes locally and fails in the pipeline, you can check the score file and the gap list before you commit a service to your test plan. AWS even documents a workflow for checking whether your specific project is expected to work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The LocalStack question
&lt;/h2&gt;

&lt;p&gt;The incumbent is not standing still, and the community is not naive about the newcomer. The Hacker News thread mixed genuine interest with pointed skepticism. One commenter wrote "RIP LocalStack" and admitted they would not be unhappy to see it go; others immediately named alternatives they already trust, including Floci and the Testcontainers modules. Another noted the repository had racked up on the order of thirty thousand commits in roughly three weeks and looked heavily AI-generated — which, one Amazon engineer in the thread argued, is rather the point: agentic development runs on closed, simulated environments, and an emulator with a published gap list is exactly the kind of harness an agent can grind against.&lt;/p&gt;

&lt;p&gt;The honest comparison comes out like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Runtime and packaging.&lt;/strong&gt; LocalStack is Python, distributed as a container or pip install, battle-tested since 2016. AWS Emulator is a single Rust binary for Linux, containers elsewhere, plus an in-process mode no Python project can match.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fidelity disclosure.&lt;/strong&gt; AWS Emulator publishes per-service scores and a file-per-gap tracker. LocalStack documents coverage on its site; neither approach is a guarantee, but only one of them is a machine-readable ledger attached to every release.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost.&lt;/strong&gt; AWS Emulator is free with no feature tier; AWS makes its money when you deploy. LocalStack's community edition is free, with paid tiers above it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Governance.&lt;/strong&gt; The AWS repository does not accept pull requests. Bug reports are welcome and have a requested format: name the service, the operation, your SDK and version, the request you sent, and how the response differed from real AWS. If your team fixes emulators by sending patches, that alone may settle the question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ecosystem.&lt;/strong&gt; Sixty-five thousand stars and a decade of Stack Overflow answers are a moat. The official tool is weeks old.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Telemetry is on by default
&lt;/h2&gt;

&lt;p&gt;One detail deserves attention before you install anything: the emulator reports usage telemetry to AWS unless you turn it off. AWS states the records are minimized, never include request or response contents, code, credentials, or personal data, and are not shared with third parties. If your organization disables telemetry as policy, there are four switches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# per process&lt;/span&gt;
aws-emulator --telemetry off

&lt;span class="c"&gt;# per shell&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;EMULATOR_TELEMETRY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;off

&lt;span class="c"&gt;# per machine, in ~/.aws/emulator/config.toml&lt;/span&gt;
&lt;span class="c"&gt;# [telemetry]&lt;/span&gt;
&lt;span class="c"&gt;# enabled = false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Embedded mode takes &lt;code&gt;Telemetry::Off&lt;/code&gt; in its options, as shown earlier. The README also asks anyone who builds a tool on top of the emulator to disclose the telemetry to their own users and provide an off switch — a clause worth knowing before you embed it in a test framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agent angle, stated plainly
&lt;/h2&gt;

&lt;p&gt;AWS clearly built this for the agent era. The README's first quick start is not a package manager command but an AI coding agent skill, installable with one command, requiring AWS CLI version 2.35.0 or later:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws agent-toolkit add-skill --skill-name aws-emulator --region us-east-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That placement is a statement of intent. A local, deterministic, account-free AWS is the missing sandbox that lets a coding agent provision, mutate, and tear down infrastructure-shaped state without touching a bill. The ten-year-old community wish for an official emulator being granted now, in this form, is consistent with the HN thread's sharpest observation: it became worth building when it became training and testing infrastructure for agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should you switch? A checklist
&lt;/h2&gt;

&lt;p&gt;Stay on your current setup if your pipeline is stable on LocalStack or Testcontainers, if you send patches to your tools, or if your services are among the emulator's 6,545 tracked gaps. Evaluate AWS Emulator now if you write Rust and want per-test in-process isolation, if you work on Linux and want a single binary, or if a published fidelity score per release answers a question your CI keeps asking. Either way, read the gap list for the services you actually use, set &lt;code&gt;EMULATOR_TELEMETRY&lt;/code&gt; to your policy's value, and pin a release. The ledger is public — use it before it uses you.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/aws-s-official-emulator-vs-localstack-160-rust-crates-fidelity-scores-per-release-and-a-telemetry-default" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>One tar Command, Eight Extractions: The 512 Bytes POSIX Left Unspecified</title>
      <dc:creator>Chen Yuan</dc:creator>
      <pubDate>Tue, 10 Nov 2026 19:04:44 +0000</pubDate>
      <link>https://dev.to/chenyuan20509/one-tar-command-eight-extractions-the-512-bytes-posix-left-unspecified-4nl7</link>
      <guid>https://dev.to/chenyuan20509/one-tar-command-eight-extractions-the-512-bytes-posix-left-unspecified-4nl7</guid>
      <description>&lt;p&gt;How many files should come out of an archive that was built from three? Every tool you have ever used will answer three, and for any normal archive they would be right. On November 7, Harmen Stoppels published a ten-kilobyte tar file, built with a single GNU tar invocation and no hand-assembled bytes, for which the honest answer depends entirely on which program you ask. GNU tar returns three files. The tar that ships with macOS returns two, one of them silently corrupted. 7-Zip returns two and never mentions the third. R returns three, one padded with 512 zero bytes it pulled from the archive's end marker. .NET, Julia, and uv's new tar-codec refuse to return anything at all. Eight distinct outcomes from one input, with no implementation bug in the usual sense: just a gap in the POSIX text that two careful reader-writers can close in different directions. This article reconstructs the archive, reruns the experiment on a real Windows machine with GNU tar 1.35, bsdtar 3.8.4, and Python 3.14.9, reads the two sentences of the standard that cause the split, and works out what a practicing engineer should change.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one-line construction
&lt;/h2&gt;

&lt;p&gt;The archive is built from three ordinary files with three commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; hello &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; file
touch empty
tar --format=pax --pax-option=&lt;span class="s1"&gt;'delete=?time,size:=512'&lt;/span&gt; \
    --transform=&lt;span class="s1"&gt;'s,^\./file,café,'&lt;/span&gt; \
    -cf hardest.tar file ./file empty
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each flag does one piece of work. The operand list names &lt;code&gt;file&lt;/code&gt; twice, once plainly and once as &lt;code&gt;./file&lt;/code&gt;. GNU tar notices both paths resolve to the same inode and stores the second entry as a hard link, typeflag 1, pointing back at &lt;code&gt;file&lt;/code&gt;. The &lt;code&gt;--transform&lt;/code&gt; expression renames that second entry to &lt;code&gt;café&lt;/code&gt;, and the non-ASCII name forces tar to write a pax extended header, the &lt;code&gt;x&lt;/code&gt; block, because a plain ustar header cannot carry the UTF-8 name. Finally, &lt;code&gt;--pax-option&lt;/code&gt; edits the extended records: &lt;code&gt;delete=?time&lt;/code&gt; strips the atime, mtime, and ctime records that pax would otherwise emit, and &lt;code&gt;size:=512&lt;/code&gt; overrides the size the link would normally declare, which is zero.&lt;/p&gt;

&lt;p&gt;The result is an archive that every tool agrees is syntactically valid. Nothing in it is truncated, misaligned, or checksummed wrong. The disagreement is entirely about what the bytes mean.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why 512 is the loaded number
&lt;/h2&gt;

&lt;p&gt;Tar is a blocked format: every header occupies exactly one 512-byte block, and every file payload is padded to a block boundary. A hard link normally declares size zero and carries no payload at all, because its content is defined to be whatever the link target holds. Setting the link's size to 512 tells a reader that exactly one payload block follows the link header. In the actual byte stream, the block that follows is the header of &lt;code&gt;empty&lt;/code&gt;, the third member. The same 512 bytes are therefore the link's payload under one reading and a member header under the other, and both readings parse cleanly.&lt;/p&gt;

&lt;p&gt;The size is chosen with precision. A smaller value would leave the parser resynchronized in the middle of the next header and produce an obvious error. A larger value would swallow more structure than one header. The value 512 is exactly one block, so the two interpretations diverge without either one tripping a format error. On the machine used for this article, the constructed archive is 10,240 bytes, and the &lt;code&gt;size=512&lt;/code&gt; record sits at offset 0x611 inside the pax data block, exactly where the construction puts it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two sentences of the standard, pulling apart
&lt;/h2&gt;

&lt;p&gt;The POSIX.1-2024 specification for pax contains both halves of the contradiction. In the extended description of the pax format, the standard says that data blocks for files of typeflag 1, the hard link, may be included. In the description of the older ustar format, it says the opposite for its own world: no data logical records are stored for types 1, 2, or 5. The archive announces itself as pax through its &lt;code&gt;x&lt;/code&gt; extended header, so the permissive sentence governs the bytes. Yet even under pax, the standard never says what such a payload means. Does it replace the contents of the link target? Attach new contents to the link itself? Is it simply to be ignored? The test-case page for this archive, F35 in Stoppels' tar-minefield suite, states the gap plainly: pax permits the data and does not say what the data does.&lt;/p&gt;

&lt;p&gt;Every implementor has had to pick a branch, and the branches were picked independently, in different languages, over two decades. That is how one sentence left unspecified turns into eight observable behaviors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three tools, three answers, one Windows box
&lt;/h2&gt;

&lt;p&gt;The experiment is cheap to repeat, and this article did repeat it. On a Windows 11 machine, the archive was built with the GNU tar 1.35 that ships with the Git for Windows toolchain, then extracted with that same GNU tar, with the bsdtar 3.8.4 that Windows installs as the system tar, and with the tarfile module of Python 3.14.9:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir out_gnu out_bsd out_py
tar --force-local -xf hardest.tar -C out_gnu
&lt;span class="s2"&gt;"C:/Windows/System32/tar.exe"&lt;/span&gt; -xf hardest.tar -C out_bsd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GNU tar's extraction is the polite outcome: three files on disk, &lt;code&gt;file&lt;/code&gt; holding the five bytes of hello, &lt;code&gt;café&lt;/code&gt; as a real hard link to it, and &lt;code&gt;empty&lt;/code&gt; at zero bytes. The oddity is in the listing. Asking the same binary for a table of contents with &lt;code&gt;tar -tf&lt;/code&gt; shows only two members, &lt;code&gt;file&lt;/code&gt; and &lt;code&gt;café&lt;/code&gt;, with the link displayed at size 512. One tool, two answers: the listing path treats the payload as belonging to the link and skips the third member, while the extraction path ignores the size and restores all three.&lt;/p&gt;

&lt;p&gt;bsdtar lands on a different branch entirely. It honors the declared size, reads the next block as the link's payload, and writes those 512 bytes into &lt;code&gt;café&lt;/code&gt;. Because &lt;code&gt;café&lt;/code&gt; is a hard link to &lt;code&gt;file&lt;/code&gt;, both names now read the same captured block, which is the header of &lt;code&gt;empty&lt;/code&gt;, beginning with the name empty followed by zeros. The member &lt;code&gt;empty&lt;/code&gt; itself never appears. Two files come out, and the file you archived with five bytes now reads back 512 bytes of someone else's header.&lt;/p&gt;

&lt;p&gt;Python shows the third personality:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;tarfile&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;tarfile&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hardest.tar"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getmembers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;linkname&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extractall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"out_py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;filter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The metadata pass reports all three members and honestly shows the link's declared size of 512, yet the extraction ignores that size and materializes &lt;code&gt;file&lt;/code&gt;, &lt;code&gt;café&lt;/code&gt;, and &lt;code&gt;empty&lt;/code&gt; exactly as archived. One machine, three tools, three different trees, all from exit-code-zero runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The full scoreboard
&lt;/h2&gt;

&lt;p&gt;The reproduction above covers three of the eight behaviors. The original post surveyed the current releases of the major implementations and sorted the rest. GNU tar, BusyBox, Python's tarfile, Go's archive/tar, and Perl's Archive::Tar form the group that ignores the size and extracts all three files. bsdtar writes the payload into the link, as seen here. 7-Zip, node-tar, tar-fs, and both Rust implementations, tar and astral-tokio-tar, agree the 512 bytes are the link's payload but skip over them instead of writing, so &lt;code&gt;empty&lt;/code&gt; silently vanishes. Java's Commons Compress keeps &lt;code&gt;file&lt;/code&gt; intact and turns &lt;code&gt;café&lt;/code&gt; into a separate regular file containing the captured header. PHP's PharData makes &lt;code&gt;café&lt;/code&gt; a separate empty file and also extracts &lt;code&gt;empty&lt;/code&gt;. RubyGems declines to extract &lt;code&gt;café&lt;/code&gt; at all and leaves a stray PaxHeaders directory behind. R's internal untar applies the size to the wrong member and delivers &lt;code&gt;empty&lt;/code&gt; padded with 512 zero bytes read from the end-of-archive marker. Haskell's tar matches GNU tar's tree but decodes the name incorrectly, writing café as mojibake on disk. And .NET, Julia's Tar.jl, and uv's tar-codec reject the archive outright.&lt;/p&gt;

&lt;h2&gt;
  
  
  The parsers that refuse, and when refusal is right
&lt;/h2&gt;

&lt;p&gt;The rejecting implementations fail with precise errors. Tar-codec reports that a member of type HardLink cannot carry payload size 512, and Julia's parser reports a hard link with non-zero size. Strictly speaking, refusal is not what POSIX asks for, since the pax text permits the payload. Stoppels argues it is still the best available answer, and the discussion around the post explains why: tar serves two masters with opposite threat models. Backup and recovery want best-effort extraction of whatever can be salvaged. Software distribution, where the archive is untrusted input from a registry or a user upload, wants fail-closed parsing, because a format disagreement between the tool that scans an archive and the tool that extracts it is exactly where supply-chain surprises live. One engineer building SBOM tooling noted in the thread that automated extractors now have to decide which tree is the real one before they can inventory it. Uv's tar-codec, written to install packages, sits at the strict end; libarchive, written to open anything, sits at the permissive end. Neither is wrong. They implement different contracts under the same three-letter name.&lt;/p&gt;

&lt;h2&gt;
  
  
  A minefield with a map
&lt;/h2&gt;

&lt;p&gt;This archive is not a one-off party trick. It is case F35, pax-size-on-hardlink, in tar-minefield, a public test suite Stoppels has been building since late October that now holds 134 ambiguous archives, each with an annotated block map, a generator script, an expected tree, and a per-tool results table. The suite also measures how exotic each construct is in the wild: across 82,586 distinct release tarballs scanned from Spack, nixpkgs, Guix, PyPI, crates.io, RubyGems, and live-bootstrap, exactly zero carry a pax size on a hard link. The construct is a lab instrument, not an exploit circulating in release tarballs. Its job is to surface parser disagreement before a real archive does it for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this changes for your pipeline
&lt;/h2&gt;

&lt;p&gt;The practical consequences are concrete. If your system extracts archives it did not create, such as CI artifacts, user uploads, or registry packages, choose a parser that rejects ambiguity rather than one that guesses politely, and record the extractor's name and version next to the artifact so the tree is reproducible. If you build recovery or forensics tooling, permissive parsing with loud warnings is the right contract instead. Never use a second tool's output as the correctness check for a first tool without expecting disagreement; bsdtar exited successfully while delivering a corrupted file, so compare extracted trees by content hash rather than by exit code. Python users get a reasonable default already, since tarfile's data filter handles links conservatively, but the metadata pass exposes the declared size on the link, which makes this family of ambiguity detectable with a three-line check.&lt;/p&gt;

&lt;p&gt;The 512 bytes inside hardest.tar are not a bug, a vulnerability, or a malformed file. They are a precise measurement of how much room a written standard leaves for interpretation, and eight mainstream tools filled that room with eight different directory trees. The next time two machines disagree about what an archive contained, the first suspect is neither the archive nor the tools, but the sentence nobody finished writing.&lt;/p&gt;




&lt;p&gt;Originally published on &lt;a href="https://dispatch-blog.hashnode.dev/one-tar-command-eight-extractions-the-512-bytes-posix-left-unspecified" rel="noopener noreferrer"&gt;Dispatch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
