<?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: 十方空烬 · Ember ☄️</title>
    <description>The latest articles on DEV Community by 十方空烬 · Ember ☄️ (@widechaos).</description>
    <link>https://dev.to/widechaos</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%2F4155333%2F0a208f72-8cde-493a-bbb0-9fc745edea42.png</url>
      <title>DEV Community: 十方空烬 · Ember ☄️</title>
      <link>https://dev.to/widechaos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/widechaos"/>
    <language>en</language>
    <item>
      <title>PNG Row Filter Desk: Why a Smaller Row Score Can Produce a Larger File</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Fri, 27 Nov 2026 06:48:02 +0000</pubDate>
      <link>https://dev.to/widechaos/png-row-filter-desk-why-a-smaller-row-score-can-produce-a-larger-file-363f</link>
      <guid>https://dev.to/widechaos/png-row-filter-desk-why-a-smaller-row-score-can-produce-a-larger-file-363f</guid>
      <description>&lt;p&gt;PNG can preserve the same RGBA8 bytes in several different forms. The step worth inspecting happens before compression: each row is filtered by predicting a byte from earlier bytes and storing a reversible difference. PNG Row Filter Desk exposes that step for small numeric grids, then hands the filtered stream to the platform DEFLATE encoder and assembles a downloadable PNG. The row score used to pick a filter is a useful local signal; it does not measure final file size.&lt;/p&gt;

&lt;p&gt;The input is a plain &lt;code&gt;{width,height,rgba}&lt;/code&gt; object. Width and height are integers from 1 to 32. The flat &lt;code&gt;rgba&lt;/code&gt; array is row-major and holds exactly four byte values per pixel, R, G, B, and A, with no inferred premultiplication. A preview can display those bytes, but it is not a byte-equality check. Fully transparent pixels still carry RGB bytes. The one-pixel sample &lt;code&gt;[17,201,129,0]&lt;/code&gt; looks empty in many composited previews, yet the decoded stream still contains 17, 201, and 129.&lt;/p&gt;

&lt;p&gt;One fixed commit contains the reference implementation and the original examples: &lt;a href="https://huggingface.co/spaces/WideChaos/png-row-filter-desk/blob/d91afff4dcdce24eb5e8f3b2d247bb8aa098ebf0/reference.py" rel="noopener noreferrer"&gt;&lt;code&gt;reference.py&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://huggingface.co/spaces/WideChaos/png-row-filter-desk/blob/d91afff4dcdce24eb5e8f3b2d247bb8aa098ebf0/core.mjs" rel="noopener noreferrer"&gt;&lt;code&gt;core.mjs&lt;/code&gt;&lt;/a&gt;, and the &lt;a href="https://huggingface.co/spaces/WideChaos/png-row-filter-desk/blob/d91afff4dcdce24eb5e8f3b2d247bb8aa098ebf0/CONTRACT.md" rel="noopener noreferrer"&gt;contract&lt;/a&gt;. The public tools are the &lt;a href="https://huggingface.co/spaces/WideChaos/png-row-filter-desk" rel="noopener noreferrer"&gt;Hugging Face Space&lt;/a&gt; and the &lt;a href="https://widechaos-png-row-filter-desk.static.hf.space/index.html" rel="noopener noreferrer"&gt;live static app&lt;/a&gt;. Filter functions and tie rules follow the &lt;a href="https://www.w3.org/TR/png-3/" rel="noopener noreferrer"&gt;W3C PNG Third Edition&lt;/a&gt;. The implementation, synthetic grids, and fixtures are mine under &lt;a href="https://huggingface.co/spaces/WideChaos/png-row-filter-desk/blob/d91afff4dcdce24eb5e8f3b2d247bb8aa098ebf0/LICENSE" rel="noopener noreferrer"&gt;Apache-2.0&lt;/a&gt;, with attribution in &lt;a href="https://huggingface.co/spaces/WideChaos/png-row-filter-desk/blob/d91afff4dcdce24eb5e8f3b2d247bb8aa098ebf0/NOTICE" rel="noopener noreferrer"&gt;NOTICE&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The filtering arithmetic
&lt;/h2&gt;

&lt;p&gt;For each byte &lt;code&gt;x&lt;/code&gt; in row &lt;code&gt;y&lt;/code&gt;, the left neighbor &lt;code&gt;a&lt;/code&gt; is four bytes earlier in the same row because RGBA has four bytes per pixel. The up neighbor &lt;code&gt;b&lt;/code&gt; is the same position in the previous row. The upper-left neighbor &lt;code&gt;c&lt;/code&gt; is four bytes earlier in the previous row. A missing neighbor is zero. The predictors are None = 0, Sub = a, Up = b, Average = floor((a+b)/2), and Paeth. Paeth chooses whichever of a, b, c is closest to &lt;code&gt;a+b-c&lt;/code&gt;; ties choose a first, then b, then c. The filtered byte is &lt;code&gt;f = (x - predictor) mod 256&lt;/code&gt;. Its signed form is &lt;code&gt;f&lt;/code&gt; when f is below 128 and &lt;code&gt;f - 256&lt;/code&gt; otherwise. The row score is the sum of absolute signed residuals.&lt;/p&gt;

&lt;p&gt;Reconstruction uses the already decoded previous bytes, so it mirrors what a decoder can do. It never uses the original raw neighbors after filtering. The filter-type byte is prepended to each row after scoring, which means it changes the scanline but does not change the already computed row score.&lt;/p&gt;

&lt;h2&gt;
  
  
  From rows to compressed IDAT
&lt;/h2&gt;

&lt;p&gt;Each row contributes one type byte and one filtered byte per RGBA byte. The total scanline length is &lt;code&gt;height * (4 * width + 1)&lt;/code&gt;. Each strategy produces one scanline stream. The browser compresses each complete stream once through &lt;code&gt;CompressionStream('deflate')&lt;/code&gt;, zlib-wrapped DEFLATE. The implementation does not compress each row separately and does not write its own DEFLATE encoder. For some inputs two strategies can produce the same scanline; the encoder does not assume the six streams are distinct.&lt;/p&gt;

&lt;p&gt;A PNG in this profile consists of the eight-byte signature, IHDR, one IDAT, and IEND. Every chunk CRC covers its type and data. The total is &lt;code&gt;57 + compressed_IDAT_bytes&lt;/code&gt;. The 57 is a fixed structural overhead count: signature 8, IHDR 25, IDAT 12 including its four-byte length field, IEND 12. That count stays fixed, but it does not mean those structure bytes have identical values across strategies. The IDAT length field changes when the compressed payload length changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a lower row score can still produce a larger file
&lt;/h2&gt;

&lt;p&gt;The white 4×3 example makes the mechanism visible. Its source is forty-eight bytes of 255. With None, every prediction is 0, so every filtered byte is 255. Each signed residual is -1, each row scores 16, and the total is 48. The heuristic picks Sub for the first row. The first pixel has no left neighbor, so its four bytes each produce residual 255 and contribute four signed points together; the other twelve bytes of that row score zero. The next two rows pick Up because they match the row above, so all their residuals are zero. The heuristic total is 4, much lower than None.&lt;/p&gt;

&lt;p&gt;The streams actually passed to DEFLATE differ. None begins with type byte 0 and then a long run of 255; heuristic begins with type byte 1, then &lt;code&gt;ff ff ff ff&lt;/code&gt;, then mostly zeros. The measured browser output was 78 bytes for heuristic and 72 bytes for None. The local Python check described later gives 77 and 72 with the fixed 57-byte structure and &lt;code&gt;zlib.compress&lt;/code&gt;. Both measurements point the same way, yet the absolute browser and local numbers differ by one byte in this case. I have not done an internal analysis of what causes that one-byte difference. After filtering, each strategy reconstructs the same RGBA through its own unfilter pass. None and heuristic do not share one identical filtered scanline, and &lt;code&gt;verify_png&lt;/code&gt; compares each strategy against its own expected scanline rather than a common one.&lt;/p&gt;

&lt;p&gt;The vertical-ramp case is another fixed input. Its name describes the sample set, not an inferred gradient axis. The 8×4 grid repeats the same row: each pixel has RGB values &lt;code&gt;31 * x&lt;/code&gt; for x from 0 to 7 and alpha 255. Fixed Sub uses the left neighbor in every row, so its filtered pattern repeats across rows, and its row score is 2608. The heuristic chooses Sub for the first row and Up for the later rows, total 652. The browser measured 82 bytes for heuristic and 79 bytes for fixed Sub. The local fixed-structure check also produces 82 and 79. Compression can use that overall row repetition. What the measured sizes show is that a smaller row score did not produce a smaller file here. I have not analyzed the platform's DEFLATE tokens or run a controlled comparison of these two streams, so I do not attribute the specific byte difference to a particular internal cause.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Heuristic score&lt;/th&gt;
&lt;th&gt;Fixed score&lt;/th&gt;
&lt;th&gt;Browser PNG bytes&lt;/th&gt;
&lt;th&gt;Local fixed 57 + zlib&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;white 4×3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;None 48&lt;/td&gt;
&lt;td&gt;heuristic 78, None 72&lt;/td&gt;
&lt;td&gt;heuristic 77, None 72&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vertical-ramp 8×4&lt;/td&gt;
&lt;td&gt;652&lt;/td&gt;
&lt;td&gt;Sub 2608&lt;/td&gt;
&lt;td&gt;heuristic 82, Sub 79&lt;/td&gt;
&lt;td&gt;heuristic 82, Sub 79&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Local values are a length cross-check computed with Python stdlib zlib and the fixed 57-byte structure. They are not a reproduction of the browser's &lt;code&gt;CompressionStream&lt;/code&gt; bytes. Where the ramp lengths match, that says nothing about whether the underlying stream bytes match. Both inputs were fixed before the compression measurements; they are observable counterexamples from one environment, not a population frequency or a universal ranking.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to keep when investigating an unexpected size
&lt;/h2&gt;

&lt;p&gt;The most useful preserved values are the five row scores per row, the selected score and filter type, the per-byte predictor/residual/reconstructed values, the complete type-prefixed scanline hex, the actual compressed IDAT hex and length, and the PNG chunk offsets with CRC equality. A score total alone does not explain a large file. When a small score produces a large output, compare the selected row types and the actual compressed IDAT, then confirm that decompressing the IDAT returns exactly that strategy's scanline and that unfiltering it returns the source RGBA. For a downloaded PNG, CRC checks the type and data fields of each chunk. Confirming the file as a whole takes more checks: signature, IHDR fields, IHDR/IDAT/IEND order, CRC, zlib decompression reaching EOF with no leftover tail, scanline equality, and independent unfilter. CRC alone does not prove structural integrity, security, or full PNG conformance.&lt;/p&gt;

&lt;p&gt;For a local sanity check, the following script downloads the fixed &lt;code&gt;reference.py&lt;/code&gt; and &lt;code&gt;examples.json&lt;/code&gt;, then uses only &lt;code&gt;filtered(request)&lt;/code&gt; and local &lt;code&gt;zlib.compress&lt;/code&gt;. It prints filtering results and a local &lt;code&gt;57 + compressed length&lt;/code&gt; figure. It does not build a new PNG, verify CRC, or claim to reproduce the browser's &lt;code&gt;CompressionStream&lt;/code&gt; bytes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env sh&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -eu
&lt;span class="nv"&gt;d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"png-desk-check"&lt;/span&gt;
mkdir -p &lt;span class="s2"&gt;"$d"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"$d"&lt;/span&gt;
&lt;span class="nv"&gt;base&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://huggingface.co/spaces/WideChaos/png-row-filter-desk/raw/d91afff4dcdce24eb5e8f3b2d247bb8aa098ebf0"&lt;/span&gt;
curl -fsSLO &lt;span class="s2"&gt;"$base/reference.py"&lt;/span&gt;
curl -fsSLO &lt;span class="s2"&gt;"$base/examples.json"&lt;/span&gt;
python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import importlib.util, json, zlib
spec &lt;span class="o"&gt;=&lt;/span&gt; importlib.util.spec_from_file_location&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ref"&lt;/span&gt;, &lt;span class="s2"&gt;"reference.py"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
ref &lt;span class="o"&gt;=&lt;/span&gt; importlib.util.module_from_spec&lt;span class="o"&gt;(&lt;/span&gt;spec&lt;span class="o"&gt;)&lt;/span&gt;
spec.loader.exec_module&lt;span class="o"&gt;(&lt;/span&gt;ref&lt;span class="o"&gt;)&lt;/span&gt;
examples &lt;span class="o"&gt;=&lt;/span&gt; json.load&lt;span class="o"&gt;(&lt;/span&gt;open&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"examples.json"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; name &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"white"&lt;/span&gt;, &lt;span class="s2"&gt;"vertical-ramp"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
    req &lt;span class="o"&gt;=&lt;/span&gt; next&lt;span class="o"&gt;(&lt;/span&gt;e&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"request"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; e &lt;span class="k"&gt;in&lt;/span&gt; examples &lt;span class="k"&gt;if&lt;/span&gt; e&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; name&lt;span class="o"&gt;)&lt;/span&gt;
    print&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="s2"&gt;"{name} {req['width']}x{req['height']}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; s &lt;span class="k"&gt;in&lt;/span&gt; ref.filtered&lt;span class="o"&gt;(&lt;/span&gt;req&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"strategies"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;:
        scan &lt;span class="o"&gt;=&lt;/span&gt; bytes.fromhex&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"scanline_hex"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        print&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"strategy"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"score"&lt;/span&gt;, s&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"score_total"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"scanline"&lt;/span&gt;, len&lt;span class="o"&gt;(&lt;/span&gt;scan&lt;span class="o"&gt;)&lt;/span&gt;,
              &lt;span class="s2"&gt;"local_57_plus_zlib"&lt;/span&gt;, 57 + len&lt;span class="o"&gt;(&lt;/span&gt;zlib.compress&lt;span class="o"&gt;(&lt;/span&gt;scan&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
              &lt;span class="s2"&gt;"roundtrip"&lt;/span&gt;, s&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"exact_rgba_roundtrip"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;verify_png(blob, request, scanline)&lt;/code&gt; is the matching entry for checking a real PNG downloaded from a report. It verifies the signature, IHDR fields, IHDR/IDAT/IEND order, chunk CRC, decompression to the end of the zlib stream with no leftover tail, exact equality with the supplied scanline for that strategy, and an independent unfilter pass back to the supplied RGBA. That combination is stronger than a visual preview or a row score.&lt;/p&gt;

&lt;p&gt;The original screenshot below shows the default 16×12 source and decoded preview along with the six measured PNG sizes. Clicking opens the original.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos-png-row-filter-desk.static.hf.space/native/layout-1280.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwidechaos-png-row-filter-desk.static.hf.space%2Fnative%2Flayout-1280.jpg" alt="Original default 16×12 result page with the source preview, decoded preview, and six measured PNG sizes." width="800" height="2774"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The five predictors, CRC32, and chunk layout are standard PNG mechanics. The heuristic is a declared row-choice rule in this desk, not a rule the specification requires. Six strategies are six lossless encodings of one grid, so equal or different sizes are observations about those encodings, not evidence that any predictor is universally better.&lt;/p&gt;

&lt;p&gt;English original: &lt;a href="https://widechaos.cn/blog/png-row-filter-desk-en" rel="noopener noreferrer"&gt;PNG Row Filter Desk: Why a Smaller Row Score Can Produce a Larger File&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>opensource</category>
      <category>testing</category>
    </item>
    <item>
      <title>Counting bytes before assuming a response: eleven selected, nine unique, two repeated</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Thu, 26 Nov 2026 05:40:40 +0000</pubDate>
      <link>https://dev.to/widechaos/counting-bytes-before-assuming-a-response-eleven-selected-nine-unique-two-repeated-49hc</link>
      <guid>https://dev.to/widechaos/counting-bytes-before-assuming-a-response-eleven-selected-nine-unique-two-repeated-49hc</guid>
      <description>&lt;p&gt;Open the default request in &lt;a href="https://huggingface.co/spaces/WideChaos/http-range-desk" rel="noopener noreferrer"&gt;HTTP Range Desk&lt;/a&gt;. It declares a ten-byte resource and has &lt;code&gt;range&lt;/code&gt; equal to &lt;code&gt;bytes=0-4,3-8&lt;/code&gt; as planner input. The visible plan is a 206 with &lt;code&gt;selected_payload_bytes&lt;/code&gt; set to &lt;code&gt;"11"&lt;/code&gt;, &lt;code&gt;unique_payload_bytes&lt;/code&gt; to &lt;code&gt;"9"&lt;/code&gt;, and &lt;code&gt;overlap_payload_bytes&lt;/code&gt; to &lt;code&gt;"2"&lt;/code&gt;. The resource length remains ten bytes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos-http-range-desk.static.hf.space/native/layout-1280.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6t1sb5r08cyrl1ia30oe.jpg" alt="HTTP Range Desk local interface screenshot showing the metadata-only default plan with length 10, a 206 plan, 11 selected payload bytes, 9 unique bytes, and 2 overlap bytes, with no bound file or observed hash." width="800" height="2384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That screenshot shows the metadata-only result. No local file is bound, so &lt;code&gt;actual_payload&lt;/code&gt; is null and no file or slice hash appears.&lt;/p&gt;

&lt;p&gt;These counts describe what the request selects. HTTP byte ranges include both endpoints. &lt;code&gt;0-4&lt;/code&gt; selects positions 0,1,2,3,4, which is five positions. &lt;code&gt;3-8&lt;/code&gt; selects positions 3,4,5,6,7,8, which is six positions. Summing the two parts gives eleven selected positions with repetition. Removing duplicates gives {0,1,2,3,4,5,6,7,8}, which is nine positions. Positions 3 and 4 appear in both parts, so the overlap is two. &lt;a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-14.1.2" rel="noopener noreferrer"&gt;RFC 9110, Section 14.1.2 Byte Ranges&lt;/a&gt; defines these positions over encoded octets. None of that changes the resource length.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;selected_payload_bytes&lt;/code&gt; is a sum of selected interval lengths as exact decimal strings. It counts repeated selection, nothing else. &lt;code&gt;unique_payload_bytes&lt;/code&gt; measures the diagnostic union. The union can merge overlapping or adjacent intervals for diagnosis, but it does not rewrite the selected parts. In this example the selected intervals stay &lt;code&gt;0-4&lt;/code&gt; and &lt;code&gt;3-8&lt;/code&gt; in request order. A multipart plan keeps each part and marks &lt;code&gt;wire_body_length_unknown&lt;/code&gt; as true because boundaries and part headers have not been constructed. Eleven is a count of selected positions, not a wire body length or a multipart &lt;code&gt;Content-Length&lt;/code&gt;. The full contract is in &lt;a href="https://huggingface.co/spaces/WideChaos/http-range-desk/blob/78e7c437762c5211e7f53cd09241c05164ea6bb1/CONTRACT.md" rel="noopener noreferrer"&gt;CONTRACT.md&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters when resuming a transfer
&lt;/h2&gt;

&lt;p&gt;Each selected interval carries &lt;code&gt;first&lt;/code&gt;, &lt;code&gt;last&lt;/code&gt;, &lt;code&gt;exclusive_end&lt;/code&gt;, and &lt;code&gt;length&lt;/code&gt;. For &lt;code&gt;3-8&lt;/code&gt;, the last position is 8, the length is 6, and the exclusive end is 9. The exclusive end is always &lt;code&gt;last + 1&lt;/code&gt;, the absolute position just past the selected bytes. The interval length is &lt;code&gt;exclusive_end - first&lt;/code&gt;, so length equals &lt;code&gt;last + 1&lt;/code&gt; only when the interval starts at zero. If a resume program mistakes last for the next absolute start, the boundary is off by one; if it mistakes last for the interval length, the error size depends on where the range starts.&lt;/p&gt;

&lt;p&gt;The difference between &lt;code&gt;selected_payload_bytes&lt;/code&gt; and &lt;code&gt;unique_payload_bytes&lt;/code&gt; shows overlap only. In this case it is 2, meaning positions 3 and 4 are selected twice. Those counts cannot distinguish two adjacent ranges from two ranges with a gap. Adjacency has to be read from the interval geometry in &lt;code&gt;selected_intervals&lt;/code&gt; and &lt;code&gt;diagnostic_union_intervals&lt;/code&gt;. If a resume request was meant to be disjoint, an overlap count is a reason to inspect the requested ranges before touching the response body.&lt;/p&gt;

&lt;p&gt;The same code keeps large offsets exact. &lt;code&gt;length&lt;/code&gt;, &lt;code&gt;first&lt;/code&gt;, &lt;code&gt;last&lt;/code&gt;, and &lt;code&gt;exclusive_end&lt;/code&gt; stay decimal strings. The JavaScript core uses BigInt and the independent &lt;a href="https://huggingface.co/spaces/WideChaos/http-range-desk/blob/78e7c437762c5211e7f53cd09241c05164ea6bb1/reference.py" rel="noopener noreferrer"&gt;reference.py&lt;/a&gt; uses Python int. No JavaScript &lt;code&gt;Number&lt;/code&gt; rounding occurs above 2^53. That matters when an offset needs to be audited or pasted into another tool as text.&lt;/p&gt;

&lt;p&gt;Byte positions also remain octet positions. A range can split a multi-byte UTF-8 character. The report does not decode the representation and then treat character indices as byte offsets. With actual local bytes bound, hashing uses the raw slice bytes before any decode.&lt;/p&gt;

&lt;h2&gt;
  
  
  A 206 plan is still a local plan
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;plan.status&lt;/code&gt; is 206 because this declared profile keeps every satisfiable part in request order after parsing and If-Range. That is a local planning result. A target server response is a separate event. A server may ignore Range, coalesce parts, or reject a large number of ranges under &lt;a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-14.2" rel="noopener noreferrer"&gt;RFC 9110, Section 14.2 Range&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The repository records seven requests to a local standard-library server. Four GET requests with valid, unsatisfiable, multipart, or If-Range fields came back with complete 200 responses and no &lt;code&gt;Content-Range&lt;/code&gt;. A HEAD request returned 200 with zero body bytes. An empty file returned 200 with zero bytes. An equal &lt;code&gt;If-Modified-Since&lt;/code&gt; plus Range returned 304. When a real server differs from the plan, check the actual status line, &lt;code&gt;Content-Range&lt;/code&gt;, and body length. A different status does not mean the byte arithmetic was wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  If-Range uses exact comparison
&lt;/h2&gt;

&lt;p&gt;One useful branch to read is a date one second later than Last-Modified. The default Last-Modified is &lt;code&gt;Sun, 06 Nov 1994 08:49:37 GMT&lt;/code&gt;. If &lt;code&gt;if_range&lt;/code&gt; is &lt;code&gt;Sun, 06 Nov 1994 08:49:38 GMT&lt;/code&gt;, the report labels the comparison &lt;code&gt;exact-seconds-not-earlier-or-equal&lt;/code&gt; and produces a full 200. This comparison accepts exact second equality only. A date earlier than Last-Modified also misses and gives full 200 under this profile, even when the caller has asserted the date is strong. Strength is assertion metadata, and the tool does not discover it. ETag comparison likewise requires both tags to be strong and the opaque values to match exactly, per &lt;a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-8.8.3.2" rel="noopener noreferrer"&gt;RFC 9110, Section 8.8.3.2 Strong Comparison&lt;/a&gt; and &lt;a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-13.1.5" rel="noopener noreferrer"&gt;Section 13.1.5 If-Range&lt;/a&gt;. A caller-supplied &lt;code&gt;base_status&lt;/code&gt; of 304 or 412 takes precedence and skips both Range and If-Range.&lt;/p&gt;

&lt;h2&gt;
  
  
  A malformed sibling changes the whole branch
&lt;/h2&gt;

&lt;p&gt;Example &lt;code&gt;bytes=0-0,8-2&lt;/code&gt; contains a reversed member. The whole Range analysis becomes malformed, and this profile plans a full 200. For a nonempty GET the planned selected interval is &lt;code&gt;[0,10)&lt;/code&gt;, with first 0, last 9, exclusive_end 10. &lt;code&gt;range_analysis.status&lt;/code&gt; stays malformed. The earlier valid member does not leak into a partial 206. This is a declared policy for an ignored malformed Range, not the only permitted server behavior. HEAD, base 304/412, all-unsatisfiable 416, and outside-profile plans are the cases with no selected representation data. A malformed nonempty GET plans the complete body.&lt;/p&gt;

&lt;p&gt;An empty representation adds a related edge. &lt;code&gt;bytes=-1&lt;/code&gt; is semantically satisfiable with an empty interval: first 0, last null, exclusive_end 0, length 0. It does not invent byte -1. The profile then chooses the permitted empty-representation ignore policy and plans 200 with zero selected bytes. Satisfiability does not mean a nonexistent byte is sent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Actual bytes and metadata need separate labels
&lt;/h2&gt;

&lt;p&gt;To observe real bytes, bind a local file of at most 1 MiB. It is read locally and never uploaded. Binding the file does not change the request. If the declared length in JSON already equals the observed byte length, compute directly. If it differs, edit the length field or use the explicit length button before the report can use the file. The report emits only when the observed length equals the asserted resource length.&lt;/p&gt;

&lt;p&gt;When bytes are bound, the report adds a whole-file SHA-256 and, for every selected part, observed slice size, full slice SHA-256, and a preview limited to the first 32 hexadecimal bytes. Those hashes establish byte consistency for the selected local file. They do not authenticate the supplied ETag, Last-Modified, date strength, or a remote representation.&lt;/p&gt;

&lt;p&gt;JSON export contains the full request snapshot, diagnostics, selected parts, and union. CSV export is a declared projection of selected intervals with ten columns, not the whole report. A header-only CSV cannot identify the status because several plans can have no selected intervals. Use JSON when the diagnosis needs full state. Exports are not anonymized. Clear removes the current request, file binding, results, and exports from the page rather than performing a secure storage erase. The CLI writes a new report exclusively with mode 0600 and observes regular inputs, without promising hostile-filesystem race resistance or atomicity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local reproduction from the fixed commit
&lt;/h2&gt;

&lt;p&gt;Download the three public source files into the same directory. The module's local entry point is &lt;code&gt;reference(q)&lt;/code&gt;. The script below prints the default 11/9/2 with selected intervals, then copies the request and changes only &lt;code&gt;if_range&lt;/code&gt; to the future-date branch.&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;set&lt;/span&gt; -eu
&lt;span class="nv"&gt;BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'https://huggingface.co/spaces/WideChaos/http-range-desk/raw/78e7c437762c5211e7f53cd09241c05164ea6bb1'&lt;/span&gt;
curl -fsSL &lt;span class="s2"&gt;"$BASE/reference.py"&lt;/span&gt; -o reference.py
curl -fsSL &lt;span class="s2"&gt;"$BASE/CONTRACT.md"&lt;/span&gt; -o CONTRACT.md
curl -fsSL &lt;span class="s2"&gt;"$BASE/default-request.json"&lt;/span&gt; -o default-request.json
python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import copy, json, reference
q &lt;span class="o"&gt;=&lt;/span&gt; json.load&lt;span class="o"&gt;(&lt;/span&gt;open&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'default-request.json'&lt;/span&gt;, &lt;span class="nv"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'utf-8'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
r &lt;span class="o"&gt;=&lt;/span&gt; reference.reference&lt;span class="o"&gt;(&lt;/span&gt;q&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'plan'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'selected_payload_bytes'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'plan'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'unique_payload_bytes'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'plan'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'overlap_payload_bytes'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'plan'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'selected_intervals'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
alt &lt;span class="o"&gt;=&lt;/span&gt; copy.deepcopy&lt;span class="o"&gt;(&lt;/span&gt;q&lt;span class="o"&gt;)&lt;/span&gt;
alt&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'if_range'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Sun, 06 Nov 1994 08:49:38 GMT'&lt;/span&gt;
a &lt;span class="o"&gt;=&lt;/span&gt; reference.reference&lt;span class="o"&gt;(&lt;/span&gt;alt&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;a&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'plan'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'status'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, a&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'plan'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'reason'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, a&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'if_range'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'comparison'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first three curl commands download public source files. After that, Python only runs local reference planning and does not contact a target server or upload a file. The source and sample bytes are Apache-2.0 under &lt;a href="https://huggingface.co/spaces/WideChaos/http-range-desk/blob/78e7c437762c5211e7f53cd09241c05164ea6bb1/LICENSE" rel="noopener noreferrer"&gt;LICENSE&lt;/a&gt;, and author-owned helper reuse is recorded in &lt;a href="https://huggingface.co/spaces/WideChaos/http-range-desk/blob/78e7c437762c5211e7f53cd09241c05164ea6bb1/NOTICE" rel="noopener noreferrer"&gt;NOTICE&lt;/a&gt;. The interactive interface is at the &lt;a href="https://widechaos-http-range-desk.static.hf.space/index.html" rel="noopener noreferrer"&gt;actual app&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;English original: &lt;a href="https://widechaos.cn/blog/http-range-desk-en" rel="noopener noreferrer"&gt;Counting bytes before assuming a response: eleven selected, nine unique, two repeated&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>http</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>testing</category>
    </item>
    <item>
      <title>Two tokens can hide two different byte splits in a byte-level BPE</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Wed, 25 Nov 2026 05:37:53 +0000</pubDate>
      <link>https://dev.to/widechaos/two-tokens-can-hide-two-different-byte-splits-in-a-byte-level-bpe-2ffa</link>
      <guid>https://dev.to/widechaos/two-tokens-can-hide-two-different-byte-splits-in-a-byte-level-bpe-2ffa</guid>
      <description>&lt;p&gt;Byte Pair Merge Desk encodes the same probe &lt;code&gt;abc&lt;/code&gt; in two ways. Ranked replay of the learned rules returns token IDs &lt;code&gt;[97, 256]&lt;/code&gt; with byte boundary cuts &lt;code&gt;[0, 1, 3]&lt;/code&gt;, the split &lt;code&gt;a | bc&lt;/code&gt;. A longest-prefix encoder reading the same structured vocabulary returns &lt;code&gt;[257, 99]&lt;/code&gt; with cuts &lt;code&gt;[0, 2, 3]&lt;/code&gt;, the split &lt;code&gt;ab | c&lt;/code&gt;. Both paths have two tokens, and both reconstruct the original bytes &lt;code&gt;616263&lt;/code&gt;. The IDs differ, and the cuts differ. The cuts are this inspector's own output fields; no model is run and no boundary array is handed to one. A token count of two hides two different ID sequences and two different byte splits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two splits for abc
&lt;/h2&gt;

&lt;p&gt;This tool's profile operates on raw bytes. Its base vocabulary has 256 IDs, one for each byte value, even when the corpus never uses some of those bytes. Learning repeatedly counts adjacent token-ID pairs inside each record, including overlapping positions, selects the maximum count, breaks ties by smallest numeric left ID and then smallest right ID, and assigns a new ID equal to 256 plus the zero-based learned rank. Replacement is non-overlapping and moves from left to right.&lt;/p&gt;

&lt;p&gt;The default corpus is four records: &lt;code&gt;bc&lt;/code&gt;, &lt;code&gt;bc&lt;/code&gt;, &lt;code&gt;ab&lt;/code&gt;, &lt;code&gt;abc&lt;/code&gt;. In hex that is &lt;code&gt;6263&lt;/code&gt;, &lt;code&gt;6263&lt;/code&gt;, &lt;code&gt;6162&lt;/code&gt;, &lt;code&gt;616263&lt;/code&gt;. The merge budget is two, and the probe is &lt;code&gt;abc&lt;/code&gt;, hex &lt;code&gt;616263&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Round zero counts the pair &lt;code&gt;(98, 99)&lt;/code&gt;, the bytes &lt;code&gt;bc&lt;/code&gt;, three times: once in each &lt;code&gt;bc&lt;/code&gt; record and once inside &lt;code&gt;abc&lt;/code&gt;. The pair &lt;code&gt;(97, 98)&lt;/code&gt;, the bytes &lt;code&gt;ab&lt;/code&gt;, counts twice at this stage, once in the &lt;code&gt;ab&lt;/code&gt; record and once inside &lt;code&gt;abc&lt;/code&gt;. Three wins, so rank zero learns &lt;code&gt;(98, 99) → 256&lt;/code&gt;. After replacement, the records are &lt;code&gt;[256]&lt;/code&gt;, &lt;code&gt;[256]&lt;/code&gt;, &lt;code&gt;[97, 98]&lt;/code&gt;, and &lt;code&gt;[97, 256]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Round one counts the remaining sequences again. The &lt;code&gt;ab&lt;/code&gt; record still contributes &lt;code&gt;(97, 98)&lt;/code&gt; once. The record that was &lt;code&gt;abc&lt;/code&gt; now contributes &lt;code&gt;(97, 256)&lt;/code&gt;, because its original &lt;code&gt;(97, 98)&lt;/code&gt; adjacency was consumed by the &lt;code&gt;bc&lt;/code&gt; merge. So &lt;code&gt;(97, 98)&lt;/code&gt; and &lt;code&gt;(97, 256)&lt;/code&gt; each have count one; the earlier count of two for &lt;code&gt;ab&lt;/code&gt; does not survive past the &lt;code&gt;bc&lt;/code&gt; merge. Both candidate left IDs are 97, and the tie rule picks the smaller right ID, 98, so rank one learns &lt;code&gt;(97, 98) → 257&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Encoding the probe &lt;code&gt;[97, 98, 99]&lt;/code&gt; replays the rules in rank order. Rank zero applies first and rewrites the probe as &lt;code&gt;[97, 256]&lt;/code&gt;. Rank one looks for &lt;code&gt;(97, 98)&lt;/code&gt;, but that pair no longer appears. The ranked result stays &lt;code&gt;[97, 256]&lt;/code&gt;, with cuts &lt;code&gt;[0, 1, 3]&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two strategies over the same vocabulary
&lt;/h2&gt;

&lt;p&gt;After two merges, this profile's full vocabulary keeps every learned token as a structured record. Each entry has its ID, hex spelling, byte length, and, for learned tokens, the parent IDs and the learned rank. The two learned rows here are ID 256 with hex &lt;code&gt;6263&lt;/code&gt;, parents &lt;code&gt;(98, 99)&lt;/code&gt;, rank 0, and ID 257 with hex &lt;code&gt;6162&lt;/code&gt;, parents &lt;code&gt;(97, 98)&lt;/code&gt;, rank 1. Even on their own, the 256-plus-rank ID numbering preserves the rank order.&lt;/p&gt;

&lt;p&gt;The greedy comparison chooses not to read those rank and parent fields. Its cursor starts at probe byte zero, and at each position it searches the vocabulary for the longest hex spelling that matches the remaining probe, with equal lengths resolved by the smallest numeric ID. At byte zero of &lt;code&gt;abc&lt;/code&gt;, the vocabulary spellings include &lt;code&gt;a&lt;/code&gt; with length one and &lt;code&gt;ab&lt;/code&gt; with length two. The longest match is ID 257, covering bytes &lt;code&gt;[0, 2)&lt;/code&gt;. The remaining byte &lt;code&gt;[2, 3)&lt;/code&gt; matches &lt;code&gt;c&lt;/code&gt;, ID 99. The greedy output is &lt;code&gt;[257, 99]&lt;/code&gt;, with cuts &lt;code&gt;[0, 2, 3]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is the useful distinction. Ranked replay uses the learned order: rank zero changed the probe before rank one was tested, so &lt;code&gt;(97, 98)&lt;/code&gt; is tried but finds no match. Longest-prefix matching ignores that order even though the vocabulary stores it. &lt;code&gt;bc&lt;/code&gt; has a vocabulary row, but it does not match at byte zero, so it never gets a chance to influence this probe. The two strategies produce different IDs and different cuts from the very same learned data. When I debug a tokenizer or compare a checkpoint with a reference implementation, the difference tells me whether the encoder actually followed the learned sequence or picked matches by a simpler view of the same table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overlapping candidates
&lt;/h2&gt;

&lt;p&gt;The second named case is one record of five &lt;code&gt;a&lt;/code&gt; bytes, hex &lt;code&gt;6161616161&lt;/code&gt;, with a one-merge budget and the same five bytes as probe. Round zero counts &lt;code&gt;(97, 97)&lt;/code&gt;, the bytes &lt;code&gt;aa&lt;/code&gt;, at four adjacent positions: 0 and 1, 1 and 2, 2 and 3, 3 and 4. Pair counting includes overlaps, so the chosen frequency is 4.&lt;/p&gt;

&lt;p&gt;Replacement is non-overlapping from the left. The pass combines positions 0 and 1, then 2 and 3, and leaves the fifth &lt;code&gt;a&lt;/code&gt; alone. That is two actual replacements and a token reduction of two. The report keeps all three numbers: chosen frequency 4, actual replacements 2, token reduction 2. The 4 is a counting result, not the round's savings; treating it as savings would overstate the reduction by two tokens.&lt;/p&gt;

&lt;p&gt;This five-byte single-round &lt;code&gt;aaaaa&lt;/code&gt; request is separate from the repeated-byte case in the original figure, which uses a two-merge budget and the four-byte probe &lt;code&gt;61616161&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the report keeps
&lt;/h2&gt;

&lt;p&gt;Every learned round keeps the full pair inventory sorted by left ID and right ID, the winning count, all tied best pairs, the parent IDs, the new ID, and the before and after state of each record with exact source-byte spans. The probe section keeps the ranked replay history, including rules that were tried and found no match, plus every greedy step with all matching candidates and tie IDs. Raw hex, token IDs, and source-byte spans are the authoritative fields. Selecting a round or changing a page only changes the on-screen table; it does not truncate exports.&lt;/p&gt;

&lt;p&gt;The downloaded JSON is the complete nested report, including the full request and all source data with byte spans. The three CSV files are complete projections. The &lt;code&gt;pairs&lt;/code&gt; CSV carries rank, left and right pair IDs, count, and the chosen/tied flags. The &lt;code&gt;merges&lt;/code&gt; CSV carries the per-round merge fields. The &lt;code&gt;probe&lt;/code&gt; CSV carries algorithm, index, ID, start, end, and hex for both probe algorithms; its hex rows can rebuild the probe byte sequence, but it has no corpus records and no request block. Exports are not an anonymization step. The JSON at least exposes the input, and the other files expose their declared columns, so I check what a file actually contains before sharing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The original figure
&lt;/h2&gt;

&lt;p&gt;The image below is the fixed source-data figure for the four predeclared cases. It shows ranked and greedy IDs, exact boundary cuts, per-round candidate counts, and actual replacement counts, including cases where the two algorithms agree. The first four entries of &lt;a href="https://huggingface.co/spaces/WideChaos/byte-pair-merge-desk/blob/00453fa2f97e80e08717732f80a25f519b6d4859/examples.json" rel="noopener noreferrer"&gt;examples.json&lt;/a&gt; at the same commit contain those case requests.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos-byte-pair-merge-desk.static.hf.space/figure.svg" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft1ao259xzg2ktb2scc05.png" alt="Byte Pair Merge Desk original figure, 1120 by 1040, showing four predeclared byte-BPE cases with ranked and longest-prefix IDs, byte cuts, candidate counts, and actual replacements per learned round" width="800" height="743"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Teaching boundaries
&lt;/h2&gt;

&lt;p&gt;This profile operates on raw bytes only. It does no Unicode normalization, no text pre-tokenization, no inserted separator, and no unknown-token fallback. A byte is not a Unicode character, and byte length is not visible character count. The base vocabulary includes all 256 one-byte tokens, even the bytes the corpus never uses. Records never merge across boundaries. A repeated record counts again, and an empty record remains part of the source identity and full record states. The probe never contributes to learning.&lt;/p&gt;

&lt;p&gt;The caps are 1 to 16 records, 0 to 128 bytes per record, 512 bytes total, 256 bytes for the probe, and 0 to 32 learned merges. Duplicate byte spellings keep distinct IDs by contract. The fixed 58-case fixture bank did not observe such a duplicate, and that absence is recorded as an observation, not a theorem.&lt;/p&gt;

&lt;p&gt;The corpus digest input is the canonical JSON of lowercase &lt;code&gt;corpus_hex&lt;/code&gt;. That serialization includes record layout, order, repeats, and empty records. The SHA-256 digest over that serialization is a noninvertible consistency fingerprint, useful for comparing source layouts. It is not authentication and not tamper protection.&lt;/p&gt;

&lt;p&gt;Input stays in browser memory and is not uploaded. Clear removes the current UI state and disables exports, which is not a secure erase. The CLI checks the input path with &lt;code&gt;lstat&lt;/code&gt; and requires a regular nonsymlink input file. Output opens with the exclusive &lt;code&gt;wx&lt;/code&gt; flag, so an existing output path or symlink is refused. These are bounded file guards, not race-free filesystem isolation.&lt;/p&gt;

&lt;p&gt;The current app is available at the formal &lt;a href="https://huggingface.co/spaces/WideChaos/byte-pair-merge-desk" rel="noopener noreferrer"&gt;Byte Pair Merge Desk&lt;/a&gt; Space and as a &lt;a href="https://widechaos-byte-pair-merge-desk.static.hf.space/index.html" rel="noopener noreferrer"&gt;standalone static page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking the two cases locally
&lt;/h2&gt;

&lt;p&gt;The fixed commit contains &lt;code&gt;reference.py&lt;/code&gt;, an independent Python implementation that models byte intervals with maps instead of mutating integer-ID arrays, and shares no production import. To repeat the two observations, download &lt;a href="https://huggingface.co/spaces/WideChaos/byte-pair-merge-desk/blob/00453fa2f97e80e08717732f80a25f519b6d4859/reference.py" rel="noopener noreferrer"&gt;reference.py at fixed commit 00453fa2&lt;/a&gt; into the current directory, then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
from reference import report, DEFAULT
r &lt;span class="o"&gt;=&lt;/span&gt; report&lt;span class="o"&gt;(&lt;/span&gt;DEFAULT&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; name &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'ranked_probe'&lt;/span&gt;, &lt;span class="s1"&gt;'greedy_probe'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
    p &lt;span class="o"&gt;=&lt;/span&gt; r&lt;span class="o"&gt;[&lt;/span&gt;name&lt;span class="o"&gt;]&lt;/span&gt;
    print&lt;span class="o"&gt;(&lt;/span&gt;name, &lt;span class="s1"&gt;'ids='&lt;/span&gt;, p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'token_ids'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
          &lt;span class="s1"&gt;'cuts='&lt;/span&gt;, p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'boundary_cuts'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
          &lt;span class="s1"&gt;'reconstructs='&lt;/span&gt;, p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'byte_reconstruction_matches'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
r2 &lt;span class="o"&gt;=&lt;/span&gt; report&lt;span class="o"&gt;(&lt;/span&gt;dict&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;corpus_hex&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'6161616161'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="nv"&gt;merge_budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1, &lt;span class="nv"&gt;probe_hex&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'6161616161'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
m &lt;span class="o"&gt;=&lt;/span&gt; r2&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'training_rounds'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;0&lt;span class="o"&gt;]&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'aaaaa round0'&lt;/span&gt;,
      &lt;span class="s1"&gt;'chosen_frequency='&lt;/span&gt;, m&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'chosen_frequency'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
      &lt;span class="s1"&gt;'actual_replacements='&lt;/span&gt;, m&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'actual_replacements'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
      &lt;span class="s1"&gt;'token_reduction='&lt;/span&gt;, m&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'token_reduction'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script prints three stdout lines. The two loop lines are the ranked and greedy results for the default &lt;code&gt;abc&lt;/code&gt; case: ranked IDs &lt;code&gt;[97, 256]&lt;/code&gt; with cuts &lt;code&gt;[0, 1, 3]&lt;/code&gt;, greedy IDs &lt;code&gt;[257, 99]&lt;/code&gt; with cuts &lt;code&gt;[0, 2, 3]&lt;/code&gt;, and both reconstruct the probe. The final line is the one-round five-byte &lt;code&gt;aaaaa&lt;/code&gt; case: chosen frequency 4, actual replacements 2, token reduction 2. The snippet checks only these two synthetic inputs. It is not a model run and does not replace the project's recorded checks.&lt;/p&gt;

&lt;p&gt;License and contract: &lt;a href="https://huggingface.co/spaces/WideChaos/byte-pair-merge-desk/blob/00453fa2f97e80e08717732f80a25f519b6d4859/LICENSE" rel="noopener noreferrer"&gt;Apache-2.0 LICENSE&lt;/a&gt;, &lt;a href="https://huggingface.co/spaces/WideChaos/byte-pair-merge-desk/blob/00453fa2f97e80e08717732f80a25f519b6d4859/PROTOCOL.md" rel="noopener noreferrer"&gt;PROTOCOL.md&lt;/a&gt;, &lt;a href="https://huggingface.co/spaces/WideChaos/byte-pair-merge-desk/blob/00453fa2f97e80e08717732f80a25f519b6d4859/MATH.md" rel="noopener noreferrer"&gt;MATH.md&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;English original: &lt;a href="https://widechaos.cn/blog/byte-pair-merge-desk-en" rel="noopener noreferrer"&gt;Two tokens can hide two different byte splits in a byte-level BPE&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>opensource</category>
      <category>testing</category>
    </item>
    <item>
      <title>Tensor Header Desk: why a flipped payload bit still passes layout checks</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Mon, 23 Nov 2026 07:02:49 +0000</pubDate>
      <link>https://dev.to/widechaos/tensor-header-desk-why-a-flipped-payload-bit-still-passes-layout-checks-2im9</link>
      <guid>https://dev.to/widechaos/tensor-header-desk-why-a-flipped-payload-bit-still-passes-layout-checks-2im9</guid>
      <description>&lt;h2&gt;
  
  
  One bit, two files, same reported digest
&lt;/h2&gt;

&lt;p&gt;The most useful case in Tensor Header Desk is a pair of files that the inspector cannot distinguish. Both files are 98,720 bytes: an 8-byte little-endian length prefix, a 384-byte JSON header, and 98,328 bytes of payload. The header declares two tensors. &lt;code&gt;bias&lt;/code&gt; is F64 with shape &lt;code&gt;[3]&lt;/code&gt; and range &lt;code&gt;[0, 24)&lt;/code&gt;. &lt;code&gt;weights&lt;/code&gt; is F64 with shape &lt;code&gt;[4096, 3]&lt;/code&gt; and range &lt;code&gt;[24, 98328)&lt;/code&gt;. Ranges are counted from the start of payload, with the end position excluded. Together the tensors hold 12,291 scalars.&lt;/p&gt;

&lt;p&gt;For the altered copy I changed exactly one bit. The last payload byte, index 98,719, received XOR 1. The prefix and header were not touched. Two independent checks agree on the header. A direct byte comparison shows that the first 392 bytes of the two files are identical. The tool reports the same header SHA-256 for both, &lt;code&gt;72b2638c12271d621908dec34e8b5389c0eb77ce70c2c1d66d692bd69300f48e&lt;/code&gt;, while the complete file SHA-256 values differ.&lt;/p&gt;

&lt;p&gt;That shared digest does not mean the files are equal. The tool hashes only the prefix plus the header, and the payload sits outside that scope. In this example the two checks support each other: the byte comparison identifies the identical stretch, and the digest records its hash. What this shows about payload is simple. A same-length change leaves declared ranges, element counts, and file size intact, and those are the only payload-facing facts the checker reads.&lt;/p&gt;

&lt;p&gt;The tool is published as a &lt;a href="https://huggingface.co/spaces/WideChaos/tensor-header-desk" rel="noopener noreferrer"&gt;Hugging Face Space&lt;/a&gt;, with a &lt;a href="https://widechaos-tensor-header-desk.static.hf.space/index.html" rel="noopener noreferrer"&gt;standalone app&lt;/a&gt; running the same code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the checker reads
&lt;/h2&gt;

&lt;p&gt;The checker is a structural lint for the moment just before a loader allocates memory. Safetensors stores tensor names, shapes, dtypes, and byte ranges in a JSON header. The first eight bytes carry the header length as a little-endian unsigned integer, and the payload follows the header. The inspector reads those eight bytes and the supported-size header, then uses the complete file size for coverage. Tensor values are never read.&lt;/p&gt;

&lt;p&gt;Against the declared ranges it checks for a truncated header, reversed ranges, offsets beyond the end of payload, overlapping tensors, holes between ranges, misplaced empty ranges, and trailing bytes after the last declared tensor. A scalar has shape &lt;code&gt;[]&lt;/code&gt; and one element. A dimension whose value is 0 leaves no elements to store.&lt;/p&gt;

&lt;p&gt;That same design explains what the checker cannot see. Ranges record endpoints and computed widths. They do not include the bytes themselves, so two payloads can occupy identical ranges while their contents differ. Interval coverage is blind to a same-length content change.&lt;/p&gt;

&lt;p&gt;The page renders the verdict, findings, tensor table, and a digest explicitly labelled prefix plus header.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos-tensor-header-desk.static.hf.space/native/desktop.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwidechaos-tensor-header-desk.static.hf.space%2Fnative%2Fdesktop.jpg" alt="Tensor Header Desk local browser inspection result" width="800" height="1478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tensor Header Desk in a local browser, original screenshot from the accepted November 5 package. The capture is the local tool UI; it says nothing about hosted behavior or weight correctness.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Capability boundaries
&lt;/h2&gt;

&lt;p&gt;Some outcomes describe what the tool can inspect rather than what is wrong with the file. A header above 1 MiB, more than 10,000 tensors, JSON nesting above 32, or an unknown dtype returns &lt;code&gt;outside-profile&lt;/code&gt;. The dtype table has 22 entries, including 4-bit and 6-bit types, but those entries are layout bit widths. The tool never decodes F4 or F6 into numbers; it only knows whether the declared bit count divides by eight.&lt;/p&gt;

&lt;p&gt;I froze a corpus of 320 synthetic and serialization fixtures and compared each against the pinned official reader, safetensors 0.8.0. If comparison is narrowed to the binary accept/reject outcome, the two readers agree on 317 of 320: both accept 283, and both reject 34. The three remaining cases differ for specific reasons. The official reader accepts a duplicate tensor name by overwriting the repeated name, while my tool rejects any decoded duplicate key at any depth by policy. The official reader accepts a valid header just over my 1 MiB cap, and it accepts 10,001 empty tensors past my 10,000 descriptor cap; my tool marks those two &lt;code&gt;outside-profile&lt;/code&gt;. Agreement here concerns the pass/reject label only. It does not say the readers produce identical parsed fields or identical interpretations of every descriptor.&lt;/p&gt;

&lt;h2&gt;
  
  
  The original model was serialized, not retrained
&lt;/h2&gt;

&lt;p&gt;The example uses my earlier CPU Character Router, the model from an out-of-domain abstention study. Its weights and bias already existed. I serialized them exactly as F64 and checked all 12,291 values against the original JSON model. This is serialization of an accepted existing model, not a new fit or a new model identity.&lt;/p&gt;

&lt;p&gt;The router's failed out-of-domain abstention result stays as it was. The tool does not run the model, and I did not run the bit-flipped file through inference to claim a measured change. The counterexample is narrow. It shows what a header-only digest and a bounded range check can say about payload contents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Whole-file equality and private report data
&lt;/h2&gt;

&lt;p&gt;A whole-file digest answers a different question. Obtained from a trusted independent channel, it can confirm that complete bytes match another copy, which is useful after a download or duplication. Byte equality does not extend to weight correctness, source safety, license validity, or loader robustness. Each of those requires separate evidence.&lt;/p&gt;

&lt;p&gt;Reports carry their own exposure. The downloaded report includes tensor names, metadata, and the original UTF-8 header, and those may contain private strings. &lt;code&gt;Clear&lt;/code&gt; removes the selection and the visible report, but it is not secure memory erasure. A selected local file stays on the File/Blob path and is never uploaded. The six included examples take a second path: the loader fetches complete same-origin JSON/base64 carriers under &lt;code&gt;fixtures-web/&lt;/code&gt;, reconstructs the exact bytes, and hands them to the same bounded inspector. Those example requests read full carrier bytes over the network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the counterexample
&lt;/h2&gt;

&lt;p&gt;To check this yourself, download the two JSON carriers from the fixed commit &lt;code&gt;c1b5e505666747c7bad5d7015b87f9ccecdf2173&lt;/code&gt;. Opening the hosted app does not create these local files; you need the actual carriers from the commit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/tensor-header-desk/blob/c1b5e505666747c7bad5d7015b87f9ccecdf2173/fixtures-web/router-good.json" rel="noopener noreferrer"&gt;router-good.json&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/tensor-header-desk/blob/c1b5e505666747c7bad5d7015b87f9ccecdf2173/fixtures-web/router-payload-bitflip.json" rel="noopener noreferrer"&gt;router-payload-bitflip.json&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Place both files in a local directory named &lt;code&gt;fixtures-web/&lt;/code&gt;, then run the script below from the directory that contains that folder. The script is a read-only stdlib reproduction for this one counterexample. The carrier hashes are consistency pins against the saved package, not an independent authenticity check.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
&lt;span class="s2"&gt;"""
Read-only check of the fixed payload-bitflip counterexample.
Put router-good.json and router-payload-bitflip.json under fixtures-web/,
then run from the directory containing that folder.
"""&lt;/span&gt;
import json, base64, hashlib, struct
from pathlib import Path

PINS &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"router-good"&lt;/span&gt;: &lt;span class="o"&gt;(&lt;/span&gt;98720, &lt;span class="s2"&gt;"eaf600b428ca7ce94e2fa420cf8e313fc702d7962a47ec819979b32174e8bc8d"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s2"&gt;"router-payload-bitflip"&lt;/span&gt;: &lt;span class="o"&gt;(&lt;/span&gt;98720, &lt;span class="s2"&gt;"d54a8ef765aba2914096aa5b71618b372e0687bacae6063b35fca16c57acf1a1"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
&lt;span class="o"&gt;}&lt;/span&gt;
HEADER_SHA &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"72b2638c12271d621908dec34e8b5389c0eb77ce70c2c1d66d692bd69300f48e"&lt;/span&gt;

def load&lt;span class="o"&gt;(&lt;/span&gt;name&lt;span class="o"&gt;)&lt;/span&gt;:
    length, pin_sha &lt;span class="o"&gt;=&lt;/span&gt; PINS&lt;span class="o"&gt;[&lt;/span&gt;name&lt;span class="o"&gt;]&lt;/span&gt;
    entry &lt;span class="o"&gt;=&lt;/span&gt; json.loads&lt;span class="o"&gt;(&lt;/span&gt;Path&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"fixtures-web"&lt;/span&gt;, name + &lt;span class="s2"&gt;".json"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.read_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&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="o"&gt;)&lt;/span&gt;, &lt;span class="nv"&gt;parse_int&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;str&lt;span class="o"&gt;)&lt;/span&gt;
    assert &lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;entry&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"schema"&lt;/span&gt;, &lt;span class="s2"&gt;"source_file"&lt;/span&gt;, &lt;span class="s2"&gt;"encoding"&lt;/span&gt;, &lt;span class="s2"&gt;"byte_length"&lt;/span&gt;, &lt;span class="s2"&gt;"sha256"&lt;/span&gt;, &lt;span class="s2"&gt;"data_base64"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
    assert entry&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"schema"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"tensor-header-example-bytes/v1"&lt;/span&gt;
    assert entry&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"encoding"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"base64"&lt;/span&gt;
    assert entry&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"source_file"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"fixtures/%s.safetensors"&lt;/span&gt; % name
    assert int&lt;span class="o"&gt;(&lt;/span&gt;entry&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"byte_length"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; length
    assert entry&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"sha256"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; pin_sha
    raw &lt;span class="o"&gt;=&lt;/span&gt; base64.b64decode&lt;span class="o"&gt;(&lt;/span&gt;entry&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"data_base64"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="nv"&gt;validate&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
    assert len&lt;span class="o"&gt;(&lt;/span&gt;raw&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; length
    assert hashlib.sha256&lt;span class="o"&gt;(&lt;/span&gt;raw&lt;span class="o"&gt;)&lt;/span&gt;.hexdigest&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; pin_sha
    n &lt;span class="o"&gt;=&lt;/span&gt; struct.unpack&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;Q"&lt;/span&gt;, raw&lt;span class="o"&gt;[&lt;/span&gt;:8&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;0&lt;span class="o"&gt;]&lt;/span&gt;
    assert n &lt;span class="o"&gt;==&lt;/span&gt; 384 and 8 + n &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; len&lt;span class="o"&gt;(&lt;/span&gt;raw&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;return&lt;/span&gt; raw&lt;span class="o"&gt;[&lt;/span&gt;:8 + n&lt;span class="o"&gt;]&lt;/span&gt;, raw

a_head, a &lt;span class="o"&gt;=&lt;/span&gt; load&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"router-good"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
b_head, b &lt;span class="o"&gt;=&lt;/span&gt; load&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"router-payload-bitflip"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
assert a_head &lt;span class="o"&gt;==&lt;/span&gt; b_head
assert hashlib.sha256&lt;span class="o"&gt;(&lt;/span&gt;a_head&lt;span class="o"&gt;)&lt;/span&gt;.hexdigest&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; HEADER_SHA
assert hashlib.sha256&lt;span class="o"&gt;(&lt;/span&gt;a&lt;span class="o"&gt;)&lt;/span&gt;.hexdigest&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; != hashlib.sha256&lt;span class="o"&gt;(&lt;/span&gt;b&lt;span class="o"&gt;)&lt;/span&gt;.hexdigest&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
diff &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;i &lt;span class="k"&gt;for&lt;/span&gt; i, &lt;span class="o"&gt;(&lt;/span&gt;x, y&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; enumerate&lt;span class="o"&gt;(&lt;/span&gt;zip&lt;span class="o"&gt;(&lt;/span&gt;a, b&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; x != y&lt;span class="o"&gt;]&lt;/span&gt;
assert diff &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;98719&lt;span class="o"&gt;]&lt;/span&gt;
assert a&lt;span class="o"&gt;[&lt;/span&gt;98719&lt;span class="o"&gt;]&lt;/span&gt; ^ b&lt;span class="o"&gt;[&lt;/span&gt;98719&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 1
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"prefix+header identical:"&lt;/span&gt;, hashlib.sha256&lt;span class="o"&gt;(&lt;/span&gt;a_head&lt;span class="o"&gt;)&lt;/span&gt;.hexdigest&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"whole SHA-256 good:"&lt;/span&gt;, hashlib.sha256&lt;span class="o"&gt;(&lt;/span&gt;a&lt;span class="o"&gt;)&lt;/span&gt;.hexdigest&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"whole SHA-256 flip:"&lt;/span&gt;, hashlib.sha256&lt;span class="o"&gt;(&lt;/span&gt;b&lt;span class="o"&gt;)&lt;/span&gt;.hexdigest&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"single differing byte:"&lt;/span&gt;, diff&lt;span class="o"&gt;[&lt;/span&gt;0&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"one bit:"&lt;/span&gt;, 1&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script decodes each carrier, checks its declared byte length and SHA-256, reads the eight-byte prefix, compares the prefix-plus-header bytes directly, and asserts the only differing byte is 98,719 with a single-bit XOR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source and license
&lt;/h2&gt;

&lt;p&gt;The original tool, synthetic fixtures, model serialization, and reports are Apache-2.0, written by me, Renchao Wu. The Safetensors format and reference implementation belong to their original authors.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/tensor-header-desk" rel="noopener noreferrer"&gt;Formal Space&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://widechaos-tensor-header-desk.static.hf.space/index.html" rel="noopener noreferrer"&gt;Standalone app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/tensor-header-desk/blob/c1b5e505666747c7bad5d7015b87f9ccecdf2173/LICENSE" rel="noopener noreferrer"&gt;Apache-2.0 license&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/tensor-header-desk/blob/c1b5e505666747c7bad5d7015b87f9ccecdf2173/PROTOCOL.md" rel="noopener noreferrer"&gt;Implementation contract&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/tensor-header-desk/blob/c1b5e505666747c7bad5d7015b87f9ccecdf2173/NOTICE" rel="noopener noreferrer"&gt;NOTICE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/tensor-header-desk/blob/c1b5e505666747c7bad5d7015b87f9ccecdf2173/demo/PROVENANCE.json" rel="noopener noreferrer"&gt;Demo provenance&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/tensor-header-desk-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>opensource</category>
      <category>testing</category>
    </item>
    <item>
      <title>Why bit accuracy can hide a wrong sum</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Sat, 21 Nov 2026 05:55:51 +0000</pubDate>
      <link>https://dev.to/widechaos/why-bit-accuracy-can-hide-a-wrong-sum-125k</link>
      <guid>https://dev.to/widechaos/why-bit-accuracy-can-hide-a-wrong-sum-125k</guid>
      <description>&lt;p&gt;A wrong integer can come with a rising bit score. This saved experiment starts from one fixed addition, then shows the same accounting trap across a larger fixed inventory.&lt;/p&gt;

&lt;p&gt;The network reads two operands one bit at a time, least significant bit first. Each real input step receives only the current two bits. The target is the matching bit of a + b. After w real input steps there is one terminal step (0, 0), so a width-w case has w + 1 output positions, with room for an overflow bit. The hidden state is the vector carried from step to step, starting at zero.&lt;/p&gt;

&lt;p&gt;The network has two inputs for the current bits, eight tanh hidden coordinates, an 8 by 8 recurrent matrix, and two softmax outputs. With both bias vectors that is 106 parameters. It was trained on operands at widths 1 through 6. Unordered numeric-pair groups were assigned as a whole to training, validation or test roles, so reverse orientations and leading-zero views cannot cross into another role. Checkpoint 80 was the earliest epoch with the lowest validation bit NLL.&lt;/p&gt;

&lt;p&gt;There are two inference modes for the same trained weights. Recurrent mode passes the previous hidden state into the next step. Reset mode clears the hidden state to zero before every input bit while all weights stay exactly the same. Reset is a post-training inference intervention, not a second fit and not a separately optimized memoryless baseline.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fixed 1 + 15 case
&lt;/h2&gt;

&lt;p&gt;The default was chosen before any model prediction. I took the first held-out width-6 ordered pair whose exact reference has at least four incoming carries equal to 1. That pair is 1 + 15.&lt;/p&gt;

&lt;p&gt;At width 6, recurrent mode predicts 16 and gets all 7 output positions right. Reset mode predicts 14 and gets 3 of 7. The target bits, least significant first, are 0000100. The reset output is 0111000. The wrong positions are 1, 2, 3 and 4.&lt;/p&gt;

&lt;p&gt;Those positions match the carry structure. Position 0 sees (1, 1) with no incoming carry and outputs 0. Positions 1 through 3 each see (0, 1), but the exact incoming carry is 1, so the target bit is 0 each time. Reset mode cannot use the hidden state, and this trained network outputs 1 at each of those three steps. Position 4 sees (0, 0) while the target bit is 1 because of the carry; reset outputs 0. This saved mapping shows how much recurrence matters for this particular network on this particular input. It does not describe every possible local rule.&lt;/p&gt;

&lt;p&gt;The exact reference computes the next bit from the current operand bits and the previous carry. In this least-significant-first representation, the mathematical recurrence needs only the carry from the prior column. That is a property of the reference rule. It does not imply the trained hidden state encodes only carry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Padding changes the denominator
&lt;/h2&gt;

&lt;p&gt;Keep the values 1 and 15 and represent them at width 64. The integers do not change. Recurrent mode still predicts 16 and gets 65 of 65 positions. Reset mode still predicts 14 and gets 61 of 65. The wrong positions remain 1, 2, 3 and 4.&lt;/p&gt;

&lt;p&gt;The added high leading-zero steps are easy for reset mode because most see (0, 0) with no incoming carry. Padding therefore raises bit accuracy without fixing the wrong sum. Bit accuracy is correct positions divided by w + 1, so the denominator includes the terminal step and every added zero step. Integer accuracy is different: the whole predicted bit string must convert to the exact sum. One wrong high-order position can still break the integer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inventory and the padding control
&lt;/h2&gt;

&lt;p&gt;The complete fixed inventory has 64,856 unique ordered operand and width cases. Recurrent mode predicts all of them correctly. Reset mode predicts 6,290 correct integers and fails on 58,566, with every failure preserved. Its integer accuracy is 9.6984 percent and bit accuracy is 59.5060 percent.&lt;/p&gt;

&lt;p&gt;The 64,882 suite memberships point at the same 64,856 unique cases. The 129,712 mode-case rows are two inference modes over one inventory, not two fits and not independent new problems. The declared primary union takes the small-group held-out views, the exhaustive new-range suites at widths 7 and 8, the fixed random new-range suites, and the padding views after deduplication. It has 64,499 unique cases, and reset gets 6,114 integers correct there, or 9.4792 percent. The complete inventory also keeps 17 exact training representations inside stress views, explicitly tagged. Those three accounting views mean different things.&lt;/p&gt;

&lt;p&gt;Widths 7 and 8 are exhaustive only under the stated condition that at least one operand sets its top bit. They contain 12,288 and 49,152 cases. Widths 16, 32 and 64 each contain 500 fixed random cases, not all 64-bit operand pairs. Wider operands change both magnitude and sequence length; the padding control is the separate view that holds values fixed and adds zero steps.&lt;/p&gt;

&lt;p&gt;The padding control starts from 64 held-out unordered numeric groups, both orientations, repeated at widths 8, 16, 32 and 64: 500 dependent views in total. At each padding width, reset mode gets exactly 21 of 125 integers right and 324 bits wrong. Its bit score climbs from 71.2 percent at width 8 to 96.01 percent at width 64, while integer accuracy stays at 16.8 percent at each width. The combined 84 correct integers is 21 times four widths. The same numeric groups repeating across widths are not independent observations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Figures
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/resolve/60cf66fc3344886646bcb27e7340bf3010ba2d11/study.png" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhuggingface.co%2Fspaces%2FWideChaos%2Fcarry-memory-lab%2Fresolve%2F60cf66fc3344886646bcb27e7340bf3010ba2d11%2Fstudy.png" alt="Study figure: training and validation bit NLL, each across 80 epochs; nine overlapping suite integer accuracies; four padding-width views for the same 125 ordered pairs; and 127 carry probes with mean wrong bits" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The study figure shows one training curve and one validation curve, each with 80 epoch points. It also keeps nine overlapping suite integer scores, the padding-width split, and 127 carry probes with mean wrong-bit counts. It supports the denominator and dependent-view limits, not a general proof.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/resolve/60cf66fc3344886646bcb27e7340bf3010ba2d11/default-states.png" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhuggingface.co%2Fspaces%2FWideChaos%2Fcarry-memory-lab%2Fresolve%2F60cf66fc3344886646bcb27e7340bf3010ba2d11%2Fdefault-states.png" alt="Default states figure: 1 + 15 at width 6, both inference modes' uncalibrated p(bit 1) curves, exact target bits, reference carry trace, and both 8 by 7 raw tanh state grids" width="799" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The default-states figure shows the two modes' uncalibrated p(bit 1) curves, the exact target bits, the reference carry trace that never enters the network, and the raw 8 by 7 tanh activations for each mode. The hidden coordinates are numeric values, not identified carry neurons.&lt;/p&gt;

&lt;p&gt;Reset mode changes the hidden-state distribution and removes recurrence while leaving the operand bits and weights unchanged. That shows sensitivity to the intervention across finite saved cases. It does not identify a causal carry neuron. Softmax probabilities are not calibrated, and NLL comes from stable log-softmax rather than from displayed rounded values. The exact XOR/AND carry reference is independent and authoritative. It never becomes a model input and never repairs a wrong neural answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the page
&lt;/h2&gt;

&lt;p&gt;The browser demo takes canonical decimal strings for operands from 0 through 2^64 minus 1, with a width from 1 through 64 that fits both operands. The sum may need 65 bits. Operands and decoded integers never pass through JavaScript Number. Current edits live in page memory; clear or refresh removes them. A deliberate download keeps the full inputs, both mode outputs, hidden states and attribution at the location you choose. Hashes check consistency only. For real calculations, use exact integer arithmetic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rechecking the saved numbers
&lt;/h2&gt;

&lt;p&gt;Obtain the fixed-commit source files and keep their relative repository paths. Downloading the static app bundle alone is not enough. The compressed artifacts must be actual gzip JSON payloads. Relevant files include &lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/blob/60cf66fc3344886646bcb27e7340bf3010ba2d11/evaluation-001/results.json" rel="noopener noreferrer"&gt;evaluation-001/results.json&lt;/a&gt;, &lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/blob/60cf66fc3344886646bcb27e7340bf3010ba2d11/evaluation-001/all-case-predictions.json.gz" rel="noopener noreferrer"&gt;evaluation-001/all-case-predictions.json.gz&lt;/a&gt;, &lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/blob/60cf66fc3344886646bcb27e7340bf3010ba2d11/data/evaluation-cases.json.gz" rel="noopener noreferrer"&gt;data/evaluation-cases.json.gz&lt;/a&gt;, and &lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/blob/60cf66fc3344886646bcb27e7340bf3010ba2d11/run-001/model.json" rel="noopener noreferrer"&gt;run-001/model.json&lt;/a&gt;. To recompute logits from weights instead of reading published predictions, also obtain &lt;code&gt;core.py&lt;/code&gt; from the same commit.&lt;/p&gt;

&lt;p&gt;Run the following from the repository root. It uses only the Python 3 standard library, reads the fixed results and the real gzip predictions, and writes no files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import gzip, json
from pathlib import Path

root &lt;span class="o"&gt;=&lt;/span&gt; Path.cwd&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
results &lt;span class="o"&gt;=&lt;/span&gt; json.loads&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;root / &lt;span class="s2"&gt;"evaluation-001/results.json"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.read_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
with gzip.open&lt;span class="o"&gt;(&lt;/span&gt;root / &lt;span class="s2"&gt;"evaluation-001/all-case-predictions.json.gz"&lt;/span&gt;, &lt;span class="s2"&gt;"rt"&lt;/span&gt;, &lt;span class="nv"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ascii"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as f:
    preds &lt;span class="o"&gt;=&lt;/span&gt; json.load&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="o"&gt;)&lt;/span&gt;

reset_all &lt;span class="o"&gt;=&lt;/span&gt; next&lt;span class="o"&gt;(&lt;/span&gt;
    r &lt;span class="k"&gt;for&lt;/span&gt; r &lt;span class="k"&gt;in&lt;/span&gt; results&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"overall"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"mode"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"reset-each-bit"&lt;/span&gt; and r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"suite"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"all"&lt;/span&gt; and r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"width"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"all"&lt;/span&gt;
&lt;span class="o"&gt;)&lt;/span&gt;
rows &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;(&lt;/span&gt;p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"mode"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"width"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;: p
    &lt;span class="k"&gt;for&lt;/span&gt; p &lt;span class="k"&gt;in&lt;/span&gt; preds
    &lt;span class="k"&gt;if&lt;/span&gt; p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"a"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt; and p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"b"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"15"&lt;/span&gt; and p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"width"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;6, 64&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; width &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;6, 64&lt;span class="o"&gt;)&lt;/span&gt;:
    &lt;span class="k"&gt;for&lt;/span&gt; mode &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"recurrent"&lt;/span&gt;, &lt;span class="s2"&gt;"reset-each-bit"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
        p &lt;span class="o"&gt;=&lt;/span&gt; rows&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;mode, width&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
        assert p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"bits"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; width + 1
        assert p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"width"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; width
        print&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="s2"&gt;"1+15 width={width} {mode}: predicted={p['predicted_sum']}, bits={p['bits']}, correct_bits={p['correct_bits']}, wrong_positions={p['wrong_positions']}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

reset_failures &lt;span class="o"&gt;=&lt;/span&gt; sum&lt;span class="o"&gt;(&lt;/span&gt;1 &lt;span class="k"&gt;for&lt;/span&gt; p &lt;span class="k"&gt;in&lt;/span&gt; preds &lt;span class="k"&gt;if&lt;/span&gt; p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"mode"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"reset-each-bit"&lt;/span&gt; and not p&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"integer_correct"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
assert reset_all&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"cases"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 64856
assert 64856 - reset_all&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"integer_correct"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; reset_failures
print&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="s2"&gt;"reset total integer failures: {reset_failures}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script outputs the two width-6 rows, the two width-64 rows, and 58,566 reset integer failures.&lt;/p&gt;

&lt;p&gt;The one fit in this experiment belongs to the frozen November 4-5 batch. This November 20 release publishes that saved experiment and adds no training. Original synthetic data, code, weights, results and figures are by Renchao Wu under &lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/blob/60cf66fc3344886646bcb27e7340bf3010ba2d11/LICENSE" rel="noopener noreferrer"&gt;Apache 2.0&lt;/a&gt;. The fixed &lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/blob/60cf66fc3344886646bcb27e7340bf3010ba2d11/PROTOCOL.md" rel="noopener noreferrer"&gt;PROTOCOL.md&lt;/a&gt; and &lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab/blob/60cf66fc3344886646bcb27e7340bf3010ba2d11/NOTICE" rel="noopener noreferrer"&gt;NOTICE&lt;/a&gt; describe the training, evaluation and licensing boundaries. The method reference is &lt;a href="https://d2l.ai/chapter_recurrent-neural-networks/bptt.html" rel="noopener noreferrer"&gt;Dive into Deep Learning, Section 9.7&lt;/a&gt;, used for BPTT principles only; no textbook code, prose or figures are copied. The project page is &lt;a href="https://huggingface.co/spaces/WideChaos/carry-memory-lab" rel="noopener noreferrer"&gt;Carry Memory Lab on Hugging Face Spaces&lt;/a&gt;, and the demo runs at &lt;a href="https://widechaos-carry-memory-lab.static.hf.space/index.html" rel="noopener noreferrer"&gt;https://widechaos-carry-memory-lab.static.hf.space/index.html&lt;/a&gt;. The 64-bit space is not exhausted, and finite passing probes do not promise reliable arbitrary-length addition.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/carry-memory-lab-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>testing</category>
    </item>
    <item>
      <title>A Known-Data Check of Red and White Wine Domain Transfer</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Fri, 20 Nov 2026 06:01:20 +0000</pubDate>
      <link>https://dev.to/widechaos/a-known-data-check-of-red-and-white-wine-domain-transfer-1bg4</link>
      <guid>https://dev.to/widechaos/a-known-data-check-of-red-and-white-wine-domain-transfer-1bg4</guid>
      <description>&lt;h2&gt;
  
  
  A known-data check of red and white wine domain transfer
&lt;/h2&gt;

&lt;p&gt;A model that looks useful on its own training source can still make worse per-record choices than a constant once it crosses to another source. I used the UCI Wine Quality files to make that gap visible with two small regressors, one trained on red wine records and one on white. The target is the sensory quality score from the source. This article records the saved run from November 4, 2026; publishing the article adds no new training.&lt;/p&gt;

&lt;p&gt;The source files contain 1,599 red rows and 4,898 white rows, 6,497 in total. The UCI page summary of 4,898 instances describes white only. Each row has 11 physicochemical inputs and an ordered quality score from 0 to 10. The source names state that the score is the median of at least three expert evaluations. Individual chemistry units are not supplied in the files, so I keep the numeric scales as they appear. Treating that ordered score as an equally spaced number for MAE and MSE is a modeling assumption, not evidence that the score sits on an interval scale.&lt;/p&gt;

&lt;p&gt;Before training, I assigned each record a role using only its 11 canonical feature values. I decimal-normalized the tokens, joined them, hashed the prefixed key with SHA-256, and used the integer modulo 10. Values 0 through 5 became a fit pool, 6 and 7 became a validation pool, and 8 and 9 became test. The same feature vector receives the same initial role in both colors, and quality and color are excluded from the key. That produces 5,318 unique groups among 6,497 rows and 1,179 duplicate-excess rows. Two exact input vectors appear in both colors. Exact vector identity is a duplicate control, not a producer or subject ID, and it does not prove that repeated rows are independent samples. Duplicate rows still enter the batch arithmetic, so they contribute repeated weight. Whether those repeated rows are ultimately independent measurements does not change that computational weighting.&lt;/p&gt;

&lt;p&gt;The red source had 923 fit-pool rows, 335 validation-pool rows, and 341 test rows. The white source had 2,939 fit-pool candidates and 977 validation-pool candidates. I sampled 923 fit rows and 335 validation rows from white, leaving 2,016 fit candidates and 642 validation candidates unused. Tests were never downsampled, so the frozen test set is the full 341 red rows plus 982 white rows, 1,323 cases in total. Those same 1,323 cases are reused across three seeds in the paired comparison below.&lt;/p&gt;

&lt;p&gt;Each source fit has 923 rows, 100 epochs, and batch size 64, giving 1,500 updates and 92,300 row visits per fit. The network is 11 inputs, 24 tanh units, and one linear output, 313 parameters. Seeds 17, 41, and 73 run for each source, giving six saved models. One initial parameter set per seed is shared between the red and white fits, three sets total; each set holds W1, b1, W2, and b2. Because each domain has its own train-only normalizer, a shared set does not necessarily define the same function on raw input scale. Validation and test rows never enter the normalizer statistics.&lt;/p&gt;

&lt;p&gt;Checkpoint selection used each model's own 335-row validation set. I picked the earliest epoch with the strictly lowest MAE among all 100 checkpoints. Selected epochs were 31, 78, and 31 for red, and 52, 39, and 39 for white. Cross-domain evaluation never used the target color's validation set. An in-domain model's own source is also its target source, so that model did see the target-source validation set.&lt;/p&gt;

&lt;p&gt;The aggregate MAE numbers are arithmetic means over three seeds, not ensembles and not confidence intervals.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test domain&lt;/th&gt;
&lt;th&gt;Red-trained&lt;/th&gt;
&lt;th&gt;White-trained&lt;/th&gt;
&lt;th&gt;Red fit mean&lt;/th&gt;
&lt;th&gt;White fit mean&lt;/th&gt;
&lt;th&gt;Cases per seed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Red&lt;/td&gt;
&lt;td&gt;0.476144&lt;/td&gt;
&lt;td&gt;0.746975&lt;/td&gt;
&lt;td&gt;0.647566&lt;/td&gt;
&lt;td&gt;0.636872&lt;/td&gt;
&lt;td&gt;341&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;White&lt;/td&gt;
&lt;td&gt;0.649987&lt;/td&gt;
&lt;td&gt;0.586350&lt;/td&gt;
&lt;td&gt;0.748883&lt;/td&gt;
&lt;td&gt;0.674610&lt;/td&gt;
&lt;td&gt;982&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The source-matched model has the lower mean error on both targets. The negative result sits inside that summary: the white-trained network is worse on the red holdout than its own fit-mean constant, 0.746975 versus 0.636872. Per seed, the three white-to-red MAE values are 0.657548, 0.732750, and 0.850627, each above that constant. The red-trained network beats the red constant on red, and the white-trained network beats the white constant on white. This is a specific cross-domain failure, not a statement that every neural model loses to every constant. The numbers also do not say that the white-trained model mostly emits its white training center, or that it learned no joint relation. They record that the aggregate error is worse than ignoring the inputs and returning the white fit mean.&lt;/p&gt;

&lt;p&gt;The per-case view shows how much an average hides. Across 3,969 same-seed, same-case paired comparisons, the in-domain model had the larger absolute error in 1,585 pairs. By target domain, 321 of 1,023 red-target pairs and 1,264 of 2,946 white-target pairs went against the in-domain model. A negative value in the paired difference means the in-domain model was worse. These counts reuse the same 1,323 cases over three seeds. They are descriptive repetition, not 3,969 independent cases, and I did not run a significance test. The target-domain split is reported, but the denominators differ, and the repeated cases mean I cannot infer from those totals that one target domain explains the failures.&lt;/p&gt;

&lt;p&gt;The fixed default case is red:0002. I selected it before any current-model test prediction as the lowest red test source ordinal. At seed 17, the red-trained model predicts 5.365765 and the white-trained model predicts 4.872778 for a true score of 5. The cross-domain model has the smaller error. I keep this case as a negative, not as a selected winner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/wine-domain-transfer/resolve/2431a336acc4cef56f12b22a90bc77baed8c6863/study.png" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhuggingface.co%2Fspaces%2FWideChaos%2Fwine-domain-transfer%2Fresolve%2F2431a336acc4cef56f12b22a90bc77baed8c6863%2Fstudy.png" alt="Six own-source validation MAE curves over 100 epochs, four seed-mean MAE bars with fit-mean diamonds, and paired absolute-error differences for red and white targets. Negative values mark the 321 red and 1,264 white cases where the in-domain model was worse." width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Figure: the actual study.png at 2015 by 1271 pixels, with all 600 own-source validation MAE points, the four seed-mean MAE bars and analytic fit-mean diamonds, and the full paired difference distributions. It is a descriptive known-data contrast, not a training-loss plot, screenshot, or causal diagram.&lt;/p&gt;

&lt;p&gt;Equal rows, equal updates, and paired initial sets are computation controls. They do not isolate a source shift. The red fit pool contains all 923 red fit candidates. The white fit pool samples 923 from 2,939 white fit candidates. Train-only normalizers differ between the two pools. Feature support, quality distribution, own validation selection, and duplicate weighting differ at the same time. The source label is not the only thing that changes. A difference between the two training-pool feature means only shows that the pools differ. It does not prove that the white-to-red failure comes from a wrong center, a missing chemical relation, or another single mechanism.&lt;/p&gt;

&lt;p&gt;Before assigning a mechanism, I would need separate runs that actually change the sampled training records under stated controls. One candidate would match the two pools by quality counts and overlapping feature support, keeping each domain's own normalizer and validation split, then check whether the white-to-red network still loses to its fit mean. Another would reweight duplicate rows down and see whether the headline errors move. Neither is part of this frozen run. The current result is a known-data descriptive comparison with the failures retained.&lt;/p&gt;

&lt;p&gt;The fixed repository includes &lt;a href="https://huggingface.co/spaces/WideChaos/wine-domain-transfer/blob/2431a336acc4cef56f12b22a90bc77baed8c6863/PROTOCOL.md" rel="noopener noreferrer"&gt;PROTOCOL.md&lt;/a&gt;, &lt;a href="https://huggingface.co/spaces/WideChaos/wine-domain-transfer/blob/2431a336acc4cef56f12b22a90bc77baed8c6863/evaluation-001/results.json" rel="noopener noreferrer"&gt;evaluation-001/results.json&lt;/a&gt;, and &lt;a href="https://huggingface.co/spaces/WideChaos/wine-domain-transfer/blob/2431a336acc4cef56f12b22a90bc77baed8c6863/evaluation-001/paired-comparisons.json" rel="noopener noreferrer"&gt;evaluation-001/paired-comparisons.json&lt;/a&gt;. Downloading only the static app page does not give you the complete set of research files. From the project root, after obtaining the fixed checkout at commit 2431a336acc4cef56f12b22a90bc77baed8c6863, the following Python 3 standard-library command recounts the headline numbers and the worse-pair split. It opens the two JSON files read-only. It does not download anything, install anything, fit anything, or write anything.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import json, collections
r &lt;span class="o"&gt;=&lt;/span&gt; json.load&lt;span class="o"&gt;(&lt;/span&gt;open&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"evaluation-001/results.json"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
p &lt;span class="o"&gt;=&lt;/span&gt; json.load&lt;span class="o"&gt;(&lt;/span&gt;open&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"evaluation-001/paired-comparisons.json"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; d &lt;span class="k"&gt;in&lt;/span&gt; r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"descriptive_seed_metric_means_not_ensemble"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;:
    print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"neural"&lt;/span&gt;, d&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"target_domain"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, d&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"trained_domain"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"mae"&lt;/span&gt;, d&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"arithmetic_mean_seed_mae"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; b &lt;span class="k"&gt;in&lt;/span&gt; r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"all_mean_baselines"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;:
    print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mean"&lt;/span&gt;, b&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"trained_domain"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"-&amp;gt;"&lt;/span&gt;, b&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"target_domain"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"mae"&lt;/span&gt;, b&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"mae"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
c &lt;span class="o"&gt;=&lt;/span&gt; collections.Counter&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"target_domain"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"in_domain_worse"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; p&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"worse_split"&lt;/span&gt;, &lt;span class="s2"&gt;"red"&lt;/span&gt;, c&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"red"&lt;/span&gt;, True&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"white"&lt;/span&gt;, c&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"white"&lt;/span&gt;, True&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"total"&lt;/span&gt;, r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"in_domain_worse_pairs"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"reuse_check"&lt;/span&gt;, r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"paired_rows"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"=="&lt;/span&gt;, 3, &lt;span class="s2"&gt;"*"&lt;/span&gt;, r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"test_cases"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;":"&lt;/span&gt;, r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"paired_rows"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 3 * r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"test_cases"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://huggingface.co/spaces/WideChaos/wine-domain-transfer" rel="noopener noreferrer"&gt;official space&lt;/a&gt; and the &lt;a href="https://widechaos-wine-domain-transfer.static.hf.space/index.html" rel="noopener noreferrer"&gt;static demo&lt;/a&gt; load six saved forward models and two analytic constants. The demo is static, with no external API or browser storage. Edits entered in the page live in browser memory, so a refresh discards them. A deliberate export writes all eleven inputs, the six model outputs, the two mean baselines, normalizers, source matches, and provenance to a local JSON file; the file stays where the reader saves it. I state this so no one trusts unsaved work to survive. Input range checks are marginal bounds, not joint chemical support. An exact feature-key match is numeric consistency, not measurement provenance. Outputs are unrounded and unclipped, with no calibrated uncertainty or probability.&lt;/p&gt;

&lt;p&gt;The original red and white CSV files and the derived weights, figures, and results retain attribution to Cortez, Cerdeira, Almeida, Matos, and Reis, UCI 186, DOI &lt;a href="https://doi.org/10.24432/C56S3T" rel="noopener noreferrer"&gt;10.24432/C56S3T&lt;/a&gt;, under &lt;a href="https://creativecommons.org/licenses/by/4.0/legalcode" rel="noopener noreferrer"&gt;CC BY 4.0&lt;/a&gt;. My code and documents are Apache 2.0. That split is recorded in &lt;a href="https://huggingface.co/spaces/WideChaos/wine-domain-transfer/blob/2431a336acc4cef56f12b22a90bc77baed8c6863/NOTICE" rel="noopener noreferrer"&gt;NOTICE&lt;/a&gt; and &lt;a href="https://huggingface.co/spaces/WideChaos/wine-domain-transfer/blob/2431a336acc4cef56f12b22a90bc77baed8c6863/LICENSES.md" rel="noopener noreferrer"&gt;LICENSES.md&lt;/a&gt;. The 2009 paper is cited as metadata; I did not read its full text, did not reproduce its model or scores, and did not use its results as my own. No tasting, health, certification, or future-vintage claim follows from this experiment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/wine-domain-transfer-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>testing</category>
    </item>
    <item>
      <title>Airfoil noise: one model saw the test condition at other frequencies, one did not</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Thu, 19 Nov 2026 05:40:20 +0000</pubDate>
      <link>https://dev.to/widechaos/airfoil-noise-one-model-saw-the-test-condition-at-other-frequencies-one-did-not-599c</link>
      <guid>https://dev.to/widechaos/airfoil-noise-one-model-saw-the-test-condition-at-other-frequencies-one-did-not-599c</guid>
      <description>&lt;p&gt;The study sits on the 1,503-row Airfoil Self-Noise set from Brooks, Pope, and Marcolini (1989), hosted on UCI as dataset 291 (DOI &lt;a href="https://doi.org/10.24432/C5VW2C" rel="noopener noreferrer"&gt;10.24432/C5VW2C&lt;/a&gt;). It has five inputs: frequency in Hz, attack angle in degrees, chord in meters, free-stream velocity in m/s, and suction-side displacement thickness in meters, plus one target, a scaled sound-pressure level in dB. It has no experiment ID. UCI's variable table labels the angle column "Binary," while the file itself holds 27 numeric angles from 0 to 22.2; I kept the real values.&lt;/p&gt;

&lt;p&gt;The missing ID is where the problem starts. Holding a test row out of training only holds that exact row out. Another row from the same physical setup, at a nearby frequency, can stay in the training set. A model that has seen that neighbor answers a different question from one that has not, even when both are scored on the same rows.&lt;/p&gt;

&lt;h2&gt;
  
  
  The condition proxy and the two pools
&lt;/h2&gt;

&lt;p&gt;I built a condition proxy from the four non-frequency features: angle, chord, velocity, and displacement thickness. Canonicalizing each value and joining them gives 106 exact tuples across the 1,503 rows. These tuples are not run IDs. Two rows sharing a tuple may still depend on each other through factors the dataset does not record.&lt;/p&gt;

&lt;p&gt;From those tuples I split the data before any model existed, using a hash of each tuple's canonical string. SHA256 of the tuple, taken modulo 10, assigns each row to a group: remainders 0 and 1 become test proxies (27 groups), 2 and 3 become validation proxies (20 groups), and 4 through 9 become base fit groups (59 groups). Inside each test group I sort rows by numeric frequency, then by original row order, and take even ranks as the common test set (201 rows) and odd ranks as context rows (185 rows). Validation uses all 274 rows of its groups. Membership is decided by hashes of feature tuples, never by target values. That is a label-blind split, but the study is not historically blind: I had already read all feature and target values before writing the protocol.&lt;/p&gt;

&lt;p&gt;Two training pools share the same 843-row budget and the same 274 validation and 201 test rows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pool A (condition_disjoint) uses all 843 base rows. It never sees any of the 27 test condition proxies.&lt;/li&gt;
&lt;li&gt;Pool B (row_context) uses all 185 context rows plus 658 base rows. The base rows are ranked lexicographically by SHA256 of "row-context-replace:" plus the full five-feature key, ties broken by original row order, and the first 658 are kept. B therefore replaces 185 of A's rows with the context rows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pool B sees other frequencies of all 27 test proxies; pool A sees none. No identical test row enters either fit. That is the one deliberate difference in the question, but the replacement also shifts which rows are covered and how each pool's normalizers are fit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Six small networks
&lt;/h2&gt;

&lt;p&gt;Each network is 5 → 24 tanh → 1 linear, 169 parameters. I trained two pools times three fixed seeds (17, 41, 73), six fits in total, each for exactly 120 epochs with batch size 32, Adam at learning rate 0.003, and a weight-only L2 of 0.0001, in NumPy float64 on CPU. For a given seed the initial parameter arrays are identical across the two pools, but each pool normalizes its inputs and target with its own 843 rows, so the initial function is not necessarily the same after normalization. Input means and population standard deviations, target mean and standard deviation, and the constant baseline all use only that pool's training rows.&lt;/p&gt;

&lt;p&gt;Each fit runs 3,240 updates and 101,160 row visits; all six together run 19,440 updates and 606,960 row visits. There is no early stopping and no sweep. The selected epoch for each model is the earliest minimum of common-validation MAE in dB; test rows never participate in selection. Selected epochs are A 116/110/118 and B 119/117/116. The six fits were completed on November 4, 2026, and this release reuses those frozen models and results, adding no new training.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers
&lt;/h2&gt;

&lt;p&gt;The table shows test MAE and RMSE for all six networks on the same 201 rows, in the target's dB units.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pool&lt;/th&gt;
&lt;th&gt;Seed&lt;/th&gt;
&lt;th&gt;Test MAE (dB)&lt;/th&gt;
&lt;th&gt;Test RMSE (dB)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;td&gt;2.637440&lt;/td&gt;
&lt;td&gt;3.433836&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;41&lt;/td&gt;
&lt;td&gt;2.685900&lt;/td&gt;
&lt;td&gt;3.475715&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;73&lt;/td&gt;
&lt;td&gt;2.610386&lt;/td&gt;
&lt;td&gt;3.387189&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;td&gt;2.268305&lt;/td&gt;
&lt;td&gt;2.979579&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;41&lt;/td&gt;
&lt;td&gt;2.301926&lt;/td&gt;
&lt;td&gt;2.995912&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;73&lt;/td&gt;
&lt;td&gt;2.399225&lt;/td&gt;
&lt;td&gt;3.197637&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The arithmetic mean of the three seed MAEs is 2.644575 dB for A and 2.323152 dB for B. That is a mean of three already-computed metrics, not an ensemble prediction and not a confidence interval.&lt;/p&gt;

&lt;p&gt;The mean does not cover every row. Pairing the two pools row by row on the same 201 test cases, once per seed, gives 603 paired comparisons. Those reuse the same 201 rows three times and are not 603 independent examples. In 237 of them, B has a larger absolute error.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Seed&lt;/th&gt;
&lt;th&gt;B smaller&lt;/th&gt;
&lt;th&gt;B equal&lt;/th&gt;
&lt;th&gt;B larger&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;td&gt;115&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;86&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;41&lt;/td&gt;
&lt;td&gt;135&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;66&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;73&lt;/td&gt;
&lt;td&gt;116&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;85&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The default case shown by the page is one of those. It is the first common-test source row (row 29) with seed 17, fixed before any model score was seen. Its recorded target is 118.129 dB. A predicts 124.342 dB (absolute error 6.213 dB) and B predicts 125.166 dB (absolute error 7.037 dB), so B is worse on the first case a visitor sees. I kept that case rather than substituting a winning seed.&lt;/p&gt;

&lt;p&gt;Two train-mean baselines, one per pool (a single analytic mean each, not six more fits), score test MAE 5.853341 dB and 5.871245 dB. Those are numerically higher than every one of the six networks on this fixed test set, which tells me the networks learned something beyond guessing the pool mean. I did not run a significance test on any of these comparisons.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the comparison supports and what it does not
&lt;/h2&gt;

&lt;p&gt;The supported claim is narrow. With the same budget, the same validation and test rows, the same architecture and optimizer, and paired seeds, the two pools produce different mean test MAEs, and B's is lower. That difference does not cover every case: 237 of 603 paired rows go the other way.&lt;/p&gt;

&lt;p&gt;I will not claim that seeing the test condition caused the improvement. Replacing 185 rows changes training coverage and the fitted normalizers at the same time it changes condition exposure. Each pool's input and target statistics are computed from its own 843 rows, and those differ. I cannot pull those apart here and assign the gap to overlap alone.&lt;/p&gt;

&lt;p&gt;Pool B also does not estimate error on unseen physical conditions. Its numbers describe a task where the test conditions' other frequencies were already in training. Pool A is a local control where the test condition proxies never entered training, but the proxy is a tuple, not a physical experiment ID, and unrecorded dependencies may remain between different tuples. None of this establishes physical experiment independence, noise compliance, or any engineering guarantee.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metric details
&lt;/h2&gt;

&lt;p&gt;The primary test MAE uses all 201 rows, a micro average. results.json also stores a macro value that averages the 27 test proxy group MAEs equally; both are in the file and neither replaces the other. The three-seed mean averages three already-computed metrics; I did not average three outputs and then measure error, and it is not a confidence band. The target unit is scaled sound-pressure dB, not A-weighted dBA, and not a pressure or energy quantity. The 603 paired rows reuse the same 201 test cases three times, so I report per-seed counts and descriptive means, treating 603 as a denominator of paired predictions rather than independent samples for a test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recomputing the numbers
&lt;/h2&gt;

&lt;p&gt;First get the full files at the fixed commit &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/tree/8ff0d17f86ce414c7eb4fba347024d443845a80e" rel="noopener noreferrer"&gt;8ff0d17f86ce414c7eb4fba347024d443845a80e&lt;/a&gt;, using the Files view rather than just the running App. Once they are local, run the block below from the package root, the directory that contains evaluation-001/. The script itself makes no network request, trains nothing, writes nothing, and uses only the Python standard library. It reads &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/blob/8ff0d17f86ce414c7eb4fba347024d443845a80e/evaluation-001/results.json" rel="noopener noreferrer"&gt;evaluation-001/results.json&lt;/a&gt; and &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/blob/8ff0d17f86ce414c7eb4fba347024d443845a80e/evaluation-001/paired-test.csv" rel="noopener noreferrer"&gt;evaluation-001/paired-test.csv&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import json, csv

with open&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"evaluation-001/results.json"&lt;/span&gt;, &lt;span class="nv"&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="o"&gt;)&lt;/span&gt; as f:
    r &lt;span class="o"&gt;=&lt;/span&gt; json.load&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="o"&gt;)&lt;/span&gt;

neural &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;m &lt;span class="k"&gt;for&lt;/span&gt; m &lt;span class="k"&gt;in&lt;/span&gt; r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"overall"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
          &lt;span class="k"&gt;if&lt;/span&gt; m&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"test"&lt;/span&gt; and m&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"kind"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"neural"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; m &lt;span class="k"&gt;in&lt;/span&gt; sorted&lt;span class="o"&gt;(&lt;/span&gt;neural, &lt;span class="nv"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lambda x: &lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"policy"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"seed"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
    print&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="s2"&gt;"{m['model_id']:22s} test MAE = {m['mae_db']:.6f} dB"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; policy &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"condition_disjoint"&lt;/span&gt;, &lt;span class="s2"&gt;"row_context"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
    vals &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;m&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"mae_db"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; m &lt;span class="k"&gt;in&lt;/span&gt; neural &lt;span class="k"&gt;if&lt;/span&gt; m&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"policy"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; policy&lt;span class="o"&gt;]&lt;/span&gt;
    print&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="s2"&gt;"{policy:22s} mean of 3 seed MAEs = {sum(vals)/len(vals):.6f} dB"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
with open&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"evaluation-001/paired-test.csv"&lt;/span&gt;, &lt;span class="nv"&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="nv"&gt;newline&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as f:
    rows &lt;span class="o"&gt;=&lt;/span&gt; list&lt;span class="o"&gt;(&lt;/span&gt;csv.DictReader&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; seed &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;17, 41, 73&lt;span class="o"&gt;)&lt;/span&gt;:
    sel &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;x &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; rows &lt;span class="k"&gt;if&lt;/span&gt; int&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"seed"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; seed&lt;span class="o"&gt;]&lt;/span&gt;
    worse &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;x &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; sel
             &lt;span class="k"&gt;if&lt;/span&gt; float&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"row_context_minus_disjoint_absolute_error_db"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 0&lt;span class="o"&gt;]&lt;/span&gt;
    d &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;float&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"row_context_minus_disjoint_absolute_error_db"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; sel&lt;span class="o"&gt;]&lt;/span&gt;
    print&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="s2"&gt;"seed {seed}: paired {len(sel)}, B worse {len(worse)}, "&lt;/span&gt;
          f&lt;span class="s2"&gt;"mean delta {sum(d)/len(d):.6f} dB"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

total_worse &lt;span class="o"&gt;=&lt;/span&gt; sum&lt;span class="o"&gt;(&lt;/span&gt;1 &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; rows
                  &lt;span class="k"&gt;if&lt;/span&gt; float&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"row_context_minus_disjoint_absolute_error_db"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 0&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="s2"&gt;"\ntotal paired {len(rows)}, total B-worse {total_worse}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The block prints the six test MAEs, the two three-seed means, the per-seed paired counts and mean deltas, and the total B-worse count. Recomputing saved predictions is verification, not another fit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The local page
&lt;/h2&gt;

&lt;p&gt;The running space is &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab" rel="noopener noreferrer"&gt;WideChaos/airfoil-split-lab&lt;/a&gt;, and the static App is &lt;a href="https://widechaos-airfoil-split-lab.static.hf.space/index.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;. The App runs the six fixed models in the browser with no model API and no server-side storage. Inputs live only in the page, so a refresh loses edits. The exported report keeps all six outputs, the full input values, the normalizers, and the hashes. Those hashes bind consistency, not authenticity.&lt;/p&gt;

&lt;p&gt;Four actually downloaded native reports keep all 24 outputs. A separate scalar reimplementation compares them with a largest difference of about 1.42e-14 dB. A different portable check over all 475 validation/test contexts times six original models agrees within 2.843e-14 dB. These are consistency checks on the product, not a new experiment and not a claim about privacy or reliability on arbitrary new inputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The figure
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/resolve/8ff0d17f86ce414c7eb4fba347024d443845a80e/split-study.png" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhuggingface.co%2Fspaces%2FWideChaos%2Fairfoil-split-lab%2Fresolve%2F8ff0d17f86ce414c7eb4fba347024d443845a80e%2Fsplit-study.png" alt="Four panels from Airfoil Split Lab: six 120-epoch validation curves, six common-test MAEs on the same 201 rows, the 603 paired error differences with 237 positive, and training proxy exposure (A sees 0 of 27 test proxies, B sees all 27)." width="800" height="615"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The four panels show all six 120-epoch validation curves with their selected epochs, the six test MAEs on the same 201 rows, the 603 paired error differences (237 positive, meaning B has the larger absolute error), and training proxy exposure (A sees 0 of the 27 test proxies, B sees all 27). It is a rendering of the frozen results, not a screenshot of the page and not a causal diagram.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source and license
&lt;/h2&gt;

&lt;p&gt;The protocol is in &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/blob/8ff0d17f86ce414c7eb4fba347024d443845a80e/PROTOCOL.md" rel="noopener noreferrer"&gt;PROTOCOL.md&lt;/a&gt; at the fixed commit. The numbers live in &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/blob/8ff0d17f86ce414c7eb4fba347024d443845a80e/evaluation-001/results.json" rel="noopener noreferrer"&gt;evaluation-001/results.json&lt;/a&gt; and &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/blob/8ff0d17f86ce414c7eb4fba347024d443845a80e/evaluation-001/paired-test.csv" rel="noopener noreferrer"&gt;evaluation-001/paired-test.csv&lt;/a&gt;, both linked above. Code and documentation are ©2026 Renchao Wu, Apache-2.0. The original data and the derived weights, normalizers, results, and figures carry Brooks/Pope/Marcolini/UCI CC BY 4.0 attribution; the notices are in &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/blob/8ff0d17f86ce414c7eb4fba347024d443845a80e/NOTICE" rel="noopener noreferrer"&gt;NOTICE&lt;/a&gt; and &lt;a href="https://huggingface.co/spaces/WideChaos/airfoil-split-lab/blob/8ff0d17f86ce414c7eb4fba347024d443845a80e/LICENSES.md" rel="noopener noreferrer"&gt;LICENSES.md&lt;/a&gt;. NASA-RP-1218 (&lt;a href="https://ntrs.nasa.gov/citations/19890016302" rel="noopener noreferrer"&gt;record&lt;/a&gt;) is cited as a source record only; I read its record, abstract, and metadata, and nothing from that report is copied or relicensed. UCI's variable table labels the angle column "Binary," but the file holds 27 numeric angles, and I kept those real values rather than binarizing them. That is a record of the discrepancy, not a change to the upstream metadata.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/airfoil-split-lab-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>testing</category>
    </item>
    <item>
      <title>Where a fixed 90% interval misses by hour</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Wed, 18 Nov 2026 06:02:55 +0000</pubDate>
      <link>https://dev.to/widechaos/where-a-fixed-90-interval-misses-by-hour-6oh</link>
      <guid>https://dev.to/widechaos/where-a-fixed-90-interval-misses-by-hour-6oh</guid>
      <description>&lt;h2&gt;
  
  
  One overall number hides the hourly misses
&lt;/h2&gt;

&lt;p&gt;A fixed 90% prediction interval covered 3,894 of 4,258 test hours. The overall rate is 91.4514%, only 1.4514 percentage points from the nominal target. That single number reads as close enough. An operator using intervals makes hour-level decisions, and for staffing or dispatch the 08:00 to 09:00 window matters more than a six-month average. This article answers a descriptive question: where do the 364 missed hours sit in the day, and what can be read from that distribution.&lt;/p&gt;

&lt;p&gt;The data are the UCI Bike Sharing hourly system-wide rental totals from Washington D.C.'s Capital Bikeshare in 2011 and 2012. They are not available bikes at a station and not unmet demand. I split the rows into four time-separated roles by target timestamp: training before 2012, Q1 for epoch selection, Q2 for frozen calibration scores, Q3 and Q4 for testing. The point model is a float64 network from 35 inputs through 32 tanh hidden units to 1 output, with 1,185 parameters, trained for 40 epochs and selected at epoch 39 by Q1 error. The three nominal levels, 95%, 90%, and 80%, reuse the same point model and the same Q2 calibration scores.&lt;/p&gt;

&lt;p&gt;Calibration uses 2,134 absolute residuals. The 90% threshold follows the order statistic &lt;code&gt;k = ceil((n+1)(d-a)/d)&lt;/code&gt;. With &lt;code&gt;n=2134&lt;/code&gt; and &lt;code&gt;a/d=1/10&lt;/code&gt;, the rank is 1,922 and the threshold is 96.621898 rentals per hour. Widths below are in hourly rental counts, not probabilities.&lt;/p&gt;

&lt;p&gt;The three fixed levels:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Nominal level&lt;/th&gt;
&lt;th&gt;Threshold&lt;/th&gt;
&lt;th&gt;Covered / 4,258&lt;/th&gt;
&lt;th&gt;Observed coverage&lt;/th&gt;
&lt;th&gt;Mean width&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;95%&lt;/td&gt;
&lt;td&gt;127.099692&lt;/td&gt;
&lt;td&gt;4,037&lt;/td&gt;
&lt;td&gt;94.8098%&lt;/td&gt;
&lt;td&gt;223.8812&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;90%, primary&lt;/td&gt;
&lt;td&gt;96.621898&lt;/td&gt;
&lt;td&gt;3,894&lt;/td&gt;
&lt;td&gt;91.4514%&lt;/td&gt;
&lt;td&gt;172.9837&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;80%&lt;/td&gt;
&lt;td&gt;62.429339&lt;/td&gt;
&lt;td&gt;3,511&lt;/td&gt;
&lt;td&gt;82.4566%&lt;/td&gt;
&lt;td&gt;114.2475&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 364 misses point in two directions: 76 truths fell below the lower bound and 288 truths exceeded the upper bound. The asymmetry is a lead worth following, since it suggests point forecasts often sit low around peak hours, but it is not an attribution on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the hour slices show
&lt;/h2&gt;

&lt;p&gt;A few representative clock hours:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hour&lt;/th&gt;
&lt;th&gt;Covered / hour rows&lt;/th&gt;
&lt;th&gt;Coverage&lt;/th&gt;
&lt;th&gt;Misses above upper bound&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;00&lt;/td&gt;
&lt;td&gt;176 / 178&lt;/td&gt;
&lt;td&gt;98.8764%&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;03&lt;/td&gt;
&lt;td&gt;175 / 175&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;07&lt;/td&gt;
&lt;td&gt;149 / 177&lt;/td&gt;
&lt;td&gt;84.1808%&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;08&lt;/td&gt;
&lt;td&gt;94 / 177&lt;/td&gt;
&lt;td&gt;53.1073%&lt;/td&gt;
&lt;td&gt;81&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;td&gt;125 / 178&lt;/td&gt;
&lt;td&gt;70.2247%&lt;/td&gt;
&lt;td&gt;43&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;142 / 178&lt;/td&gt;
&lt;td&gt;79.7753%&lt;/td&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Overnight hours miss rarely, and the misses gather near the morning and evening peaks. I also made a post hoc coarse split of test targets from 07:00 through 19:59 in one group and all other hours in another. This split was not preregistered. The daytime group has 2,308 rows and 1,968 covers, or 85.2686%; the other group has 1,950 rows and 1,926 covers, or 98.7692%. The two groups add back to 4,258 rows and 3,894 covers.&lt;/p&gt;

&lt;p&gt;Months vary too. September covered 631 / 720 = 87.6389%, October 589 / 684 = 86.1111%, and December 674 / 696 = 96.8391%. I do not attribute those differences to season alone, because the data do not support that single-cause reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Width and coverage are separate observations
&lt;/h2&gt;

&lt;p&gt;The interval is &lt;code&gt;[max(0, point-q), point+q]&lt;/code&gt;. When the point forecast is below q, the lower bound clips to zero and the width becomes point+q, smaller than the full 2q. For 90%, 2q is 193.2438 rentals while the test mean width is 172.9837, and the gap comes from that lower-bound clip. The saved hour-level mean widths show where the clip bites. Hour 03 has a mean width of 108.1440, hour 08 has 190.1621, and hour 17 has 192.9269. Low-count overnight hours carry narrower absolute intervals, and peak hours sit closer to 2q.&lt;/p&gt;

&lt;p&gt;Coverage direction and width direction are different facts. Overnight hours have narrow intervals and almost all covers. Peak hours have wider intervals and more misses, with 81 truths above the upper bound at hour 08. That combination is consistent with several mechanisms: point predictions running low on some high-count hours, residual scale changing by hour, or a distribution shift between the Q2 calibration period and the Q3/Q4 test period. The coverage table cannot separate those. I do not claim any one of them as the identified cause, and I do not claim that switching to another score would necessarily help. The next diagnostic step is to read the saved &lt;code&gt;point-predictions.csv&lt;/code&gt; and look at the sign of the signed difference &lt;code&gt;truth - point&lt;/code&gt; computed from its truth and prediction columns, plus the magnitude in its &lt;code&gt;absolute_residual&lt;/code&gt; column, by hour bucket and by point level.&lt;/p&gt;

&lt;h2&gt;
  
  
  What these rows can support
&lt;/h2&gt;

&lt;p&gt;Every test target needs its previous 24 nominal hours, and evaluation rolls one hour forward, using only actual counts that have already occurred. Adjacent nominal targets share 23 input hours. Members of one hour bucket, such as the 177 targets at hour 08, sit about 24 hours apart. The overlap of adjacent windows does not by itself prove that all rows within one hour bucket are dependent. The precise claim I can hold is that independence and exchangeability are not shown to hold on this sequence, and not refuted either. The hour and month tables are therefore descriptive summaries. I run no significance test, build no error bars, and promise no probability for a single input or a future month.&lt;/p&gt;

&lt;p&gt;The test role has 4,376 original rows, and 118 targets lacked their preceding hours, so they stay out of the coverage denominator and remain in the inventory. My conclusion covers only those 4,258 eligible hours. The source dataset and the earlier benchmark were already inspected in prior work, so this check is not blind. The usual marginal coverage theorem gives its guarantee when calibration and test scores are exchangeable and the fitted procedure is independent of the calibration labels. That premise is not shown to hold on this sequence, so the experiment does not claim the theorem's guarantee and does not assert that the sequence has been proved non-exchangeable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recheck the saved summaries
&lt;/h2&gt;

&lt;p&gt;The script below uses the Python3 standard library and should run from the root of the complete fixed package. It reads only the saved scores and grouped summaries in &lt;code&gt;calibration-001/calibration.json&lt;/code&gt; and &lt;code&gt;evaluation-001/results.json&lt;/code&gt;. It loads no weights, rebuilds no 24-hour windows, fits no model, and does not re-derive the full interval CSV row by row. I do not treat this printout as a new independent performance test.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
from pathlib import Path
import json
import math

root &lt;span class="o"&gt;=&lt;/span&gt; Path&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"."&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
cal &lt;span class="o"&gt;=&lt;/span&gt; json.loads&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;root / &lt;span class="s2"&gt;"calibration-001/calibration.json"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.read_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&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="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
scores &lt;span class="o"&gt;=&lt;/span&gt; cal&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"scores"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
a, d &lt;span class="o"&gt;=&lt;/span&gt; 1, 10
k &lt;span class="o"&gt;=&lt;/span&gt; math.ceil&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;len&lt;span class="o"&gt;(&lt;/span&gt;scores&lt;span class="o"&gt;)&lt;/span&gt; + 1&lt;span class="o"&gt;)&lt;/span&gt; * &lt;span class="o"&gt;(&lt;/span&gt;d - a&lt;span class="o"&gt;)&lt;/span&gt; / d&lt;span class="o"&gt;)&lt;/span&gt;
q &lt;span class="o"&gt;=&lt;/span&gt; sorted&lt;span class="o"&gt;(&lt;/span&gt;scores&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;k - 1&lt;span class="o"&gt;]&lt;/span&gt;

res &lt;span class="o"&gt;=&lt;/span&gt; json.loads&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;root / &lt;span class="s2"&gt;"evaluation-001/results.json"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.read_text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&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="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
primary &lt;span class="o"&gt;=&lt;/span&gt; next&lt;span class="o"&gt;(&lt;/span&gt;r &lt;span class="k"&gt;for&lt;/span&gt; r &lt;span class="k"&gt;in&lt;/span&gt; res&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"intervals"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"alpha_denominator"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 10&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"n_scores"&lt;/span&gt;, len&lt;span class="o"&gt;(&lt;/span&gt;scores&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="s2"&gt;"rank"&lt;/span&gt;, k, &lt;span class="s2"&gt;"q"&lt;/span&gt;, q&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"overall"&lt;/span&gt;, primary&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"overall"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"n"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, primary&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"overall"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"covered"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;,
      primary&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"overall"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"miss_above"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, primary&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"overall"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"miss_below"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; h &lt;span class="k"&gt;in&lt;/span&gt; sorted&lt;span class="o"&gt;(&lt;/span&gt;primary&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"hour"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="nv"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lambda s: int&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;:
    row &lt;span class="o"&gt;=&lt;/span&gt; primary&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"hour"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;h&lt;span class="o"&gt;]&lt;/span&gt;
    print&lt;span class="o"&gt;(&lt;/span&gt;h, row&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"n"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, row&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"covered"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, round&lt;span class="o"&gt;(&lt;/span&gt;row&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"coverage"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, 6&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output gives &lt;code&gt;n_scores=2134&lt;/code&gt;, &lt;code&gt;rank=1922&lt;/code&gt;, and overall values 4,258, 3,894, 288, 76. The 95% and 80% groupings live in the same &lt;a href="https://huggingface.co/spaces/WideChaos/forecast-interval-lab/blob/747f64a8adba84a346502d82568364086d8fff66/evaluation-001/results.json" rel="noopener noreferrer"&gt;&lt;code&gt;evaluation-001/results.json&lt;/code&gt;&lt;/a&gt;. Calibration scores are in &lt;a href="https://huggingface.co/spaces/WideChaos/forecast-interval-lab/blob/747f64a8adba84a346502d82568364086d8fff66/calibration-001/calibration.json" rel="noopener noreferrer"&gt;&lt;code&gt;calibration-001/calibration.json&lt;/code&gt;&lt;/a&gt;, and the order-statistic rule is in &lt;a href="https://huggingface.co/spaces/WideChaos/forecast-interval-lab/blob/747f64a8adba84a346502d82568364086d8fff66/quantiles.py" rel="noopener noreferrer"&gt;&lt;code&gt;quantiles.py&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The fixed-commit repository is &lt;a href="https://huggingface.co/spaces/WideChaos/forecast-interval-lab" rel="noopener noreferrer"&gt;&lt;code&gt;WideChaos/forecast-interval-lab&lt;/code&gt;&lt;/a&gt;, and the standalone app entry is &lt;a href="https://widechaos-forecast-interval-lab.static.hf.space/index.html" rel="noopener noreferrer"&gt;https://widechaos-forecast-interval-lab.static.hf.space/index.html&lt;/a&gt;. The app runs the fixed model and three frozen thresholds in browser memory, with no inference API and no autosave. The explicit JSON download contains the full input, so users should inspect it before sharing. The single actual training run finished on 2026-11-04; this publication reuses that model, calibration, and complete results, and performs no new training.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/forecast-interval-lab/resolve/747f64a8adba84a346502d82568364086d8fff66/interval-study.png" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhuggingface.co%2Fspaces%2FWideChaos%2Fforecast-interval-lab%2Fresolve%2F747f64a8adba84a346502d82568364086d8fff66%2Finterval-study.png" alt="The fixed scientific four-panel figure showing all 40 training and selection loss points, monthly coverage, monthly mean width, and the four-role eligibility and omission counts" width="800" height="667"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This 1200×1000 original figure shows the loss trace, monthly coverage and width, and the four-role denominators. It does not show hourly coverage.&lt;/p&gt;

&lt;p&gt;The data are Hadi Fanaee-T's Bike Sharing dataset, UCI page &lt;a href="https://archive.ics.uci.edu/dataset/275/bike+sharing+dataset" rel="noopener noreferrer"&gt;https://archive.ics.uci.edu/dataset/275/bike+sharing+dataset&lt;/a&gt;, &lt;a href="https://doi.org/10.24432/C5W894" rel="noopener noreferrer"&gt;DOI 10.24432/C5W894&lt;/a&gt;. The method background is Angelopoulos and Bates, &lt;a href="https://arxiv.org/abs/2107.07511v6" rel="noopener noreferrer"&gt;arXiv:2107.07511v6&lt;/a&gt;; I use only the absolute-residual and order-statistic framework and do not copy their code, figures, or empirical studies. The data and derived weights, calibration scores, results, and figures keep CC BY 4.0 attribution. My code and documentation are Apache-2.0, by Renchao Wu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/forecast-interval-lab-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>testing</category>
    </item>
    <item>
      <title>How a three-label softmax router accepted a soup recipe as notes</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Mon, 16 Nov 2026 05:33:52 +0000</pubDate>
      <link>https://dev.to/widechaos/how-a-three-label-softmax-router-accepted-a-soup-recipe-as-notes-104p</link>
      <guid>https://dev.to/widechaos/how-a-three-label-softmax-router-accepted-a-soup-recipe-as-notes-104p</guid>
      <description>&lt;p&gt;I kept this failure in the fixed commit &lt;code&gt;bd2a30de287fe419b7d31838b40f5ae4d2d70061&lt;/code&gt;. "Suggest a soup recipe." does not belong to weather, calendar, or notes, but the saved test prediction for &lt;code&gt;ood-template-4-en&lt;/code&gt; has &lt;code&gt;top_route&lt;/code&gt; equal to notes, a maximum of 0.486, and accepted true at the 0.4 threshold.&lt;/p&gt;

&lt;p&gt;This package is small. It turns text into 4,096-dimensional character n-gram counts, applies a linear transform and three-way softmax, and was fit on 96 author-written training records for one 300-epoch CPU run. The 204 synthetic records split into 96 training, 54 validation, and 54 test; the original templates are written and visible to me, so these records were not handled as a human-blind benchmark.&lt;/p&gt;

&lt;p&gt;The mechanism sits in the softmax denominator. &lt;a href="https://huggingface.co/WideChaos/char-router-abstention-study/blob/bd2a30de287fe419b7d31838b40f5ae4d2d70061/router.py" rel="noopener noreferrer"&gt;&lt;code&gt;router.py&lt;/code&gt;&lt;/a&gt; sets &lt;code&gt;confidence&lt;/code&gt; to the largest softmax value, then accepts when &lt;code&gt;confidence &amp;gt;= threshold&lt;/code&gt;; below threshold, &lt;code&gt;route&lt;/code&gt; is null. Because the three probabilities sum to one, the maximum cannot fall below about 1/3. That lower bound is arithmetic, neither a calibrated probability nor a membership certificate. The recipe's notes score of 0.486 is only about 0.152 above a uniform 1/3. It clears 0.4 because the model slightly prefers notes and the threshold is exactly 0.4. I have not run per-feature attribution, so I cannot say which words pushed notes to the top.&lt;/p&gt;

&lt;p&gt;The threshold came from a fixed rule. &lt;a href="https://huggingface.co/WideChaos/char-router-abstention-study/blob/bd2a30de287fe419b7d31838b40f5ae4d2d70061/validation-thresholds.json" rel="noopener noreferrer"&gt;&lt;code&gt;validation-thresholds.json&lt;/code&gt;&lt;/a&gt; shows that a candidate needed validation accepted precision of at least 0.9, then the chosen threshold was the one with the most correct accepted rows. At 0.4, validation had 44 correct among 47 accepted; 0.5 and 0.6 were also feasible but accepted far fewer. This is empirical selection, not calibration. At 0.4, validation accepted 3 of its 6 OOD rows.&lt;/p&gt;

&lt;p&gt;On test, &lt;a href="https://huggingface.co/WideChaos/char-router-abstention-study/blob/bd2a30de287fe419b7d31838b40f5ae4d2d70061/test-report.json" rel="noopener noreferrer"&gt;&lt;code&gt;test-report.json&lt;/code&gt;&lt;/a&gt; gives known top-1 44/48, acceptance 52/54, accepted precision 43/52, and OOD false acceptance 6/6. The 52 accepted rows split into 6 OOD plus 46 known rows. Among those 46 known rows, 43 are top-1 correct and 3 are top-1 wrong yet accepted. Two known rows were rejected: one correct and one wrong. The drop to 43/52 therefore combines six OOD accepts and three known wrong accepts, not a single OOD effect.&lt;/p&gt;

&lt;p&gt;Run this block directly at the package root. It reads saved &lt;code&gt;test-predictions.jsonl&lt;/code&gt; with the Python 3 standard library only, and it does not retrain, infer again, or touch the network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import json

with open&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test-predictions.jsonl'&lt;/span&gt;, &lt;span class="nv"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'utf-8'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as f:
    rows &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;json.loads&lt;span class="o"&gt;(&lt;/span&gt;line&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; line &lt;span class="k"&gt;in&lt;/span&gt; f &lt;span class="k"&gt;if&lt;/span&gt; line.strip&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
recipe &lt;span class="o"&gt;=&lt;/span&gt; next&lt;span class="o"&gt;(&lt;/span&gt;x &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; rows &lt;span class="k"&gt;if&lt;/span&gt; x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'id'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'ood-template-4-en'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
ood &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;x &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; rows &lt;span class="k"&gt;if&lt;/span&gt; x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'label'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'ood'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
known_accepted &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;x &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; rows &lt;span class="k"&gt;if&lt;/span&gt; x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'label'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; != &lt;span class="s1"&gt;'ood'&lt;/span&gt; and x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'accepted'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
known_rejected &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;x &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; rows &lt;span class="k"&gt;if&lt;/span&gt; x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'label'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; != &lt;span class="s1"&gt;'ood'&lt;/span&gt; and not x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'accepted'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;json.dumps&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s1"&gt;'recipe_row'&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;k: recipe&lt;span class="o"&gt;[&lt;/span&gt;k&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; k &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'id'&lt;/span&gt;, &lt;span class="s1"&gt;'top_route'&lt;/span&gt;, &lt;span class="s1"&gt;'probabilities'&lt;/span&gt;, &lt;span class="s1"&gt;'threshold'&lt;/span&gt;, &lt;span class="s1"&gt;'accepted'&lt;/span&gt;, &lt;span class="s1"&gt;'reason'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;,
    &lt;span class="s1"&gt;'ood_total'&lt;/span&gt;: len&lt;span class="o"&gt;(&lt;/span&gt;ood&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s1"&gt;'ood_accepted'&lt;/span&gt;: sum&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'accepted'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; ood&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s1"&gt;'test_accepted_total'&lt;/span&gt;: sum&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'accepted'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; rows&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s1"&gt;'test_known_accepted_correct'&lt;/span&gt;: sum&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'accepted'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; and x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'top_route'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'label'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; rows &lt;span class="k"&gt;if&lt;/span&gt; x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'label'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; != &lt;span class="s1"&gt;'ood'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s1"&gt;'known_accepted_total'&lt;/span&gt;: len&lt;span class="o"&gt;(&lt;/span&gt;known_accepted&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s1"&gt;'known_accepted_correct'&lt;/span&gt;: sum&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'top_route'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'label'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; known_accepted&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s1"&gt;'known_rejected_total'&lt;/span&gt;: len&lt;span class="o"&gt;(&lt;/span&gt;known_rejected&lt;span class="o"&gt;)&lt;/span&gt;,
    &lt;span class="s1"&gt;'known_rejected_correct'&lt;/span&gt;: sum&lt;span class="o"&gt;(&lt;/span&gt;x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'top_route'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; x&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'label'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; x &lt;span class="k"&gt;in&lt;/span&gt; known_rejected&lt;span class="o"&gt;)&lt;/span&gt;,
&lt;span class="o"&gt;}&lt;/span&gt;, &lt;span class="nv"&gt;ensure_ascii&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;False, &lt;span class="nv"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If NumPy 2.5.4 is installed from &lt;a href="https://huggingface.co/WideChaos/char-router-abstention-study/blob/bd2a30de287fe419b7d31838b40f5ae4d2d70061/requirements.txt" rel="noopener noreferrer"&gt;&lt;code&gt;requirements.txt&lt;/code&gt;&lt;/a&gt;, replay one CPU inference in the same directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python router.py model.json &lt;span class="s2"&gt;"Suggest a soup recipe."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The package boundary matters too. It is a local NumPy CPU command-line model, with no hosted App and no Transformers or inference Provider integration that I have verified; it never executes a weather, calendar, or notes action. For reuse, the code, synthetic data, and trained weights are released under Apache-2.0, copyright Renchao Wu. NumPy is installed separately, not vendored, and its own license terms apply as described in &lt;a href="https://huggingface.co/WideChaos/char-router-abstention-study/blob/bd2a30de287fe419b7d31838b40f5ae4d2d70061/DEPENDENCIES.md" rel="noopener noreferrer"&gt;&lt;code&gt;DEPENDENCIES.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This example is useful because it separates two signals. With fixed classes and no explicit reject class, max softmax always gives an out-of-domain request a relative highest route. In a real chain, what matters is which branch a false accept enters and what that branch costs. If &lt;code&gt;route&lt;/code&gt; is wired directly to a real note-saving branch, the recipe request may enter that path; the model package itself does not perform that step. Known-route accuracy and threshold precision are useful numbers, but neither alone says the routing is reliable.&lt;/p&gt;

&lt;p&gt;The data is small, with only three OOD test examples per language. The 20/24 and 24/24 known-route language counts do not support a language superiority claim or an open-world false-accept rate. This counterexample is bounded by the fixed model, data, and threshold rule, and it does not become a general theorem against all softmax abstention schemes.&lt;/p&gt;

&lt;p&gt;Author: Renchao Wu&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/static/assets/projects/char-router-hf-overview-97580526187a.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3pgf2rhcfhcvbvltkd8a.jpg" alt="The image shows the original anonymous Hugging Face model card with the recipe request accepted as notes and the local command-line usage boundary; click to open the full 1280×720 JPEG" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The model card page keeps the same failure note and local CPU command-line boundary. Its source page is &lt;a href="https://huggingface.co/WideChaos/char-router-abstention-study" rel="noopener noreferrer"&gt;WideChaos/char-router-abstention-study&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/char-router-abstention-study-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>testing</category>
      <category>opensource</category>
    </item>
    <item>
      <title>What Three MAE Values on One Fixed Split Support</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Sun, 15 Nov 2026 05:38:18 +0000</pubDate>
      <link>https://dev.to/widechaos/what-three-mae-values-on-one-fixed-split-support-1jip</link>
      <guid>https://dev.to/widechaos/what-three-mae-values-on-one-fixed-split-support-1jip</guid>
      <description>&lt;p&gt;By Renchao Wu&lt;/p&gt;

&lt;p&gt;Open &lt;a href="https://huggingface.co/spaces/WideChaos/bike-hour-forecast" rel="noopener noreferrer"&gt;Bike Hour Forecast&lt;/a&gt; and the page shows three mean absolute errors: 33.85, 86.91, 80.94. Before moving toward standard errors, confidence intervals, or paired tests, it helps to pin down what those numbers support. I wrote this article from the complete public package at pinned commit &lt;a href="https://huggingface.co/spaces/WideChaos/bike-hour-forecast/commit/12485db6742972da6589e0ae3454657255b5fb24" rel="noopener noreferrer"&gt;12485db6742972da6589e0ae3454657255b5fb24&lt;/a&gt;. The static entry is &lt;a href="https://widechaos-bike-hour-forecast.static.hf.space/index.html" rel="noopener noreferrer"&gt;widechaos-bike-hour-forecast.static.hf.space&lt;/a&gt;, and the source data is from &lt;a href="https://doi.org/10.24432/C5W894" rel="noopener noreferrer"&gt;UCI Bike Sharing&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  One frozen result, not a blind test
&lt;/h2&gt;

&lt;p&gt;The source is hourly system-aggregated recorded rentals for Washington D.C. in 2011-2012. &lt;code&gt;data/hour.csv&lt;/code&gt; has 17,379 rows, with 165 nominal hours absent between the first and last timestamps. Missing hours are not zero-filled, and they are not compressed into earlier observed rows. The test split originally contains 4,376 targets. Of those, 4,258 have a complete 24-hour lag window and enter scoring; 118 are omitted because their windows are incomplete.&lt;/p&gt;

&lt;p&gt;The network is a 1,185-parameter residual model, trained on CPU for 40 epochs, with validation MAE selecting epoch 20. That fit happened once, and I have not retrained it today. The two baselines are untrained: repeating the previous hour, and repeating the same hour 24 hours earlier. All three are scored on the same 4,258 eligible test targets: 33.84762126909047 for the neural model, 86.90535462658525 for the previous hour, and 80.93846876467825 for the lag-24 hour.&lt;/p&gt;

&lt;p&gt;Those numbers are a descriptive comparison on one fixed historical split. They show that this neural model has a lower average absolute error on the same target set. They do not come with an uncertainty bound, a significance result, residual autocorrelation, or an effective-sample-size conclusion. The source audit read all original counts before freezing, so the frozen files do not prove a historical blind test; calling this a test split does not mean the article has performed one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/static/assets/projects/bike-hour-hf-overview-93457006ebb3.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3gb75ozfbpt57xpcppg6.jpg" alt="Hugging Face Space overview showing 4,258 eligible test targets, 4,376 source test targets, and the three MAE values under the historical aggregate scope" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adjacent targets inside rolling windows
&lt;/h2&gt;

&lt;p&gt;Every eligible target needs all 24 immediately preceding nominal hours to exist. When two adjacent nominal hours are both eligible, their input windows share 23 hours. That sharing comes from the window definition, and it only means the errors belong to one overlapping chronological sequence. It does not reveal whether neighboring errors are strongly or weakly correlated, positively or negatively. It also does not mean effective information is necessarily smaller, or that an independence-based standard error points a particular way.&lt;/p&gt;

&lt;p&gt;I ran a read-only geometry check on the saved &lt;code&gt;evaluation-001/predictions.csv&lt;/code&gt;. Filtering to the test split gives 4,258 rows, 4,258 unique timestamps, 4,253 adjacent nominal-hour pairs, and 4 nonadjacent pairs. The check confirms one row per test target, rather than three method rows per target. It does not compute any correlation between errors.&lt;/p&gt;

&lt;p&gt;The timing is more specific. The validation split covers January through June 2012, and the test split covers July through December 2012. A validation target can only use observations that have already happened at its timestamp, so it cannot read future test records. A later test target can use earlier training, validation, or test observations once those hours have happened. Context may cross split boundaries, but each step is made at its own point in time. This is not a recursive forecast of six months from one fixed origin.&lt;/p&gt;

&lt;h2&gt;
  
  
  4,258 is a target count, not a duration
&lt;/h2&gt;

&lt;p&gt;The saved sequence has 4,258 eligible test time points, including 4 nonadjacent pairs. That number is useful as the denominator behind the three MAE values and as a count of hourly targets that entered scoring. It is not a continuous 4,258-hour span, and it is not automatically a proven count of independent trials.&lt;/p&gt;

&lt;p&gt;Moving from this number to standard errors, confidence intervals, or significance requires deciding a statistical protocol first: the time-dependence model, the inference target, and the supporting assumptions, then checking that protocol against concrete data. The frozen public package does not publish that protocol. Switching to a non-overlapping evaluation split does not by itself guarantee independent errors either, because the split changes which targets are scored. That design would need its own validation.&lt;/p&gt;

&lt;p&gt;The worst test point is worth citing separately. On 2012-09-08T16:00:00 the truth is 114 and the neural forecast is 509.01461577302854, an absolute error of about 395.01. It stays in the complete results and supports one bounded sentence: an average improvement does not make every abrupt point dependable. No available material attributes that record to a specific event, weather pattern, or policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the geometry at the package root
&lt;/h2&gt;

&lt;p&gt;I have restored the public package at the pinned commit. The script below reads only the saved &lt;code&gt;evaluation-001/predictions.csv&lt;/code&gt;. It does not train, infer, call the network, or use any third-party package; it needs only the Python 3 standard library. The expected output is four lines.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'PY'&lt;/span&gt;
import csv
from datetime import datetime, timedelta

with open&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'evaluation-001/predictions.csv'&lt;/span&gt;, &lt;span class="nv"&gt;newline&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;, &lt;span class="nv"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'utf-8'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as f:
    rows &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;r &lt;span class="k"&gt;for&lt;/span&gt; r &lt;span class="k"&gt;in&lt;/span&gt; csv.DictReader&lt;span class="o"&gt;(&lt;/span&gt;f&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'split'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'test'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;

ts &lt;span class="o"&gt;=&lt;/span&gt; sorted&lt;span class="o"&gt;(&lt;/span&gt;datetime.fromisoformat&lt;span class="o"&gt;(&lt;/span&gt;r&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'timestamp'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; r &lt;span class="k"&gt;in&lt;/span&gt; rows&lt;span class="o"&gt;)&lt;/span&gt;
adjacent &lt;span class="o"&gt;=&lt;/span&gt; sum&lt;span class="o"&gt;(&lt;/span&gt;b - a &lt;span class="o"&gt;==&lt;/span&gt; timedelta&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;hours&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; a, b &lt;span class="k"&gt;in&lt;/span&gt; zip&lt;span class="o"&gt;(&lt;/span&gt;ts, ts&lt;span class="o"&gt;[&lt;/span&gt;1:&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test_saved_rows'&lt;/span&gt;, len&lt;span class="o"&gt;(&lt;/span&gt;rows&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'unique_test_timestamps'&lt;/span&gt;, len&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;ts&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'adjacent_nominal_hour_pairs'&lt;/span&gt;, adjacent&lt;span class="o"&gt;)&lt;/span&gt;
print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'nonadjacent_pairs'&lt;/span&gt;, len&lt;span class="o"&gt;(&lt;/span&gt;ts&lt;span class="o"&gt;)&lt;/span&gt; - 1 - adjacent&lt;span class="o"&gt;)&lt;/span&gt;
PY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it at the root of the complete public package from the pinned commit, so the read path matches the package layout. The output should be &lt;code&gt;test_saved_rows 4258&lt;/code&gt;, &lt;code&gt;unique_test_timestamps 4258&lt;/code&gt;, &lt;code&gt;adjacent_nominal_hour_pairs 4253&lt;/code&gt;, and &lt;code&gt;nonadjacent_pairs 4&lt;/code&gt;. It reproduces the saved geometry and adds no new statistical result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Boundaries for use and redistribution
&lt;/h2&gt;

&lt;p&gt;The target is always that historical system-aggregated rental count, not station availability, latent unmet demand, or demand in a current city. Timestamps are nominal calendar hours, with no UTC or daylight-saving reconstruction. Excluding incomplete windows may keep easier periods in the score. The 100,000 cap is a preset numeric rule. Browser inference stays in memory; refreshing or editing clears the old result and download link. The explicit JSON export includes all 24 input rows, and its hash describes byte consistency, not source authenticity or model quality.&lt;/p&gt;

&lt;p&gt;The license is layered. Code, browser UI, tests, and protocol text are Apache-2.0. The original UCI data and the derived weights, results, and figures are CC BY 4.0, with Hadi Fanaee-T and &lt;a href="https://doi.org/10.24432/C5W894" rel="noopener noreferrer"&gt;DOI 10.24432/C5W894&lt;/a&gt; attribution retained. Histories entered by a user keep their own terms; code, training data, or attribution in an exported report does not automatically relicense them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/bike-hour-forecast-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>datascience</category>
      <category>opensource</category>
    </item>
    <item>
      <title>When 75% Is Not the Whole Score: Auditing Predictions by Denominator</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Sun, 15 Nov 2026 05:36:36 +0000</pubDate>
      <link>https://dev.to/widechaos/when-75-is-not-the-whole-score-auditing-predictions-by-denominator-1mm9</link>
      <guid>https://dev.to/widechaos/when-75-is-not-the-whole-score-auditing-predictions-by-denominator-1mm9</guid>
      <description>&lt;h2&gt;
  
  
  A 75% score over four rows
&lt;/h2&gt;

&lt;p&gt;Put one number on the table and break it open. Suppose an eight-row inventory and its predictions show 75% correct. That fraction covers four records: id0, id1, id4, and id6. id2 abstains, id3 has no prediction line, id5 is invalid because of conflicting duplicates, and id7 has null gold. None enters the A/C=3/4 numerator or denominator, but the inventory still has eight rows. The number itself does not say which rows left, so the per-row filters belong next to it.&lt;/p&gt;

&lt;p&gt;prediction-metric-desk is a local audit desk that compares an inventory with saved predictions and counts them. It trains nothing, infers nothing, and does not rewrite invalid rows. The eight-row fixture is a fixed fault set included in the package. The inventory has N=8 records, with K=7 known gold and null gold for id7. The predictions file has 11 physical lines, including one broken JSON line, one extra ID, and duplicate id5 lines. These rows stay in the report.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/static/assets/projects/prediction-metric-hf-results-21eb110fb3fa.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjzgapb5i7u03xo5gk7e0.jpg" alt="Fixed eight-row synthetic fixture on the standalone App page, showing 75% conditional accuracy, 4/7 known-gold coverage, 5/8 coverage, and visual infinity for NLL" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The screenshot comes from the standalone App page and is uncropped. The App renders NLL as ∞ and notes zero true-class probability. The exported JSON writes the same condition as value:null and infinite:true, two representations with no change to the metric definition.&lt;/p&gt;

&lt;h2&gt;
  
  
  Record-level map
&lt;/h2&gt;

&lt;p&gt;One clarification first: labels are &lt;code&gt;["a","b","missing"]&lt;/code&gt;, and &lt;code&gt;"missing"&lt;/code&gt; is a legitimate taxonomy string, not a missing value. id4 has gold label &lt;code&gt;"missing"&lt;/code&gt; and predicted label &lt;code&gt;"missing"&lt;/code&gt;, so this line counts as correct. That is separate from id3's missing state, which means there is no prediction line at all.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;id&lt;/th&gt;
&lt;th&gt;gold&lt;/th&gt;
&lt;th&gt;prediction line&lt;/th&gt;
&lt;th&gt;C&lt;/th&gt;
&lt;th&gt;D&lt;/th&gt;
&lt;th&gt;E&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td&gt;predicted a, probabilities [0.8,0.1,0.1]&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td&gt;predicted b, probabilities [0,1,0]&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td&gt;predicted null, probabilities [0.1,0.8,0.1]&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td&gt;no prediction line&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;"missing"&lt;/td&gt;
&lt;td&gt;predicted "missing", no probabilities&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;"missing"&lt;/td&gt;
&lt;td&gt;two lines: a and typo, invalid&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;a&lt;/td&gt;
&lt;td&gt;predicted a, probabilities [0.1,0.8,0.1]&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;td&gt;predicted b, probabilities [0.1,0.8,0.1]&lt;/td&gt;
&lt;td&gt;unscored&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;From the table: C contains id0, id1, id4, and id6; three of them are correct, so A=3, C=4, and A/C=75%. id2 has probabilities but a null predicted_label, so it is abstained and enters D but not C or E. id4 has a decision and no probabilities, so it enters C/E and not D. id5 has two conflicting physical lines, so the record is invalid and stays out of C/D/E; both original lines remain visible in prediction_lines, while line_accounting carries counts such as invalid_lines and not the raw rows themselves. id7 has null gold, is not scored, and enters E only. The extra ID is separate from inventory cases.&lt;/p&gt;

&lt;p&gt;C and D both equal 4 in this fixture by coincidence, but their members differ: id2 is in D and not C, id4 is in C and not D. Reading 4 as the same filter misses that difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coverage needs three rates
&lt;/h2&gt;

&lt;p&gt;E counts a single valid prediction line with a non-null predicted_label, regardless of gold, so id7 qualifies and E=5. C counts decided rows among known gold, so C=4. C/K=4/7 asks what share of known-gold rows decided; E/N=5/8 asks what share of inventory emitted a label; A/C=3/4 asks what share of those decisions were correct. Treating A/C as overall accuracy drops the first two denominators.&lt;/p&gt;

&lt;p&gt;U=K-C=3. If I force all three undecided rows to answer, completed accuracy runs from A/K=3/7 to (A+K-C)/K=6/7. The range assumes all three are wrong or all three are right. It is not a confidence interval and not a promise. It shows how sensitive the current 0.75 is to those rows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Probability support and decision labels
&lt;/h2&gt;

&lt;p&gt;D counts known-gold rows with one valid prediction line and a non-null probabilities vector, four in this fixture. Label order is a, b, &lt;code&gt;"missing"&lt;/code&gt;; id1 has true class a and vector &lt;code&gt;[0,1,0]&lt;/code&gt;, whose first term for a is zero. Mean NLL is therefore infinite. The exported report writes value:null, infinite:true, zero_probability_rows:1, and support:4; the page renders ∞. I do not clip the value, renormalize the vector, or fabricate a one-hot output. predicted_label may also differ from probabilities argmax: id6 has predicted_label a while its argmax is b. The report records that mismatch and does not override the policy label.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the fixture with one command
&lt;/h2&gt;

&lt;p&gt;From the package root, with Node 22 or newer and no existing output file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node audit_cli.mjs data/fault-inventory.json data/fault-predictions.jsonl my-audit.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;stdout is JSON. This block is an excerpt of key fields, not the full stdout; the full report is written to my-audit.json with cases as record-level status, prediction_lines as original physical lines with line errors, and line_accounting as a physical-line summary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"denominators"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"N"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"K"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"E"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"C"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"A"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"U"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"D"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"metrics"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"coverage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.625&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"known_gold_coverage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.5714285714285714&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"conditional_accuracy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"completion_bounds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.42857142857142855&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.8571428571428571&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"nll"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"value"&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="nl"&gt;"infinite"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"zero_probability_rows"&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="nl"&gt;"support"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&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;That command verifies the table without recomputing the 3080-row result. Entry points and fixed version:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://widechaos-prediction-metric-desk.static.hf.space/index.html" rel="noopener noreferrer"&gt;Standalone App page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/prediction-metric-desk" rel="noopener noreferrer"&gt;HF Space&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/prediction-metric-desk/commit/cb003655f55c5a9153bceaa7fde897ec598d7011" rel="noopener noreferrer"&gt;Fixed source commit cb003655f55c5a9153bceaa7fde897ec598d7011&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I still recommend the standalone App page as the stable entry point. The inline Hub view appeared blank in a minimized Edge environment on 2026-11-13, and that cause remains unproven. On 2026-11-14, a signed-out inline browser environment previewed and applied the fault fixture and showed N=8, C=4, A=3, D=4, conditional accuracy 3/4, known-gold coverage 4/7, and infinite NLL. That success is limited to the new signed-out context; it does not show the original Edge issue is fixed, the root cause is known, or every browser and entry point works.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the report carries
&lt;/h2&gt;

&lt;p&gt;Active audit work and newly imported inputs live in browser memory and clear on refresh. There is no autosave and no crash checkpoint. A downloaded JSON report itself remains on disk, but it cannot be reimported as a checkpoint, and refreshing does not reload it automatically. The exported report contains full original inventory and predictions, so I check what is inside before sharing. SHA256 proves byte consistency, not provenance, authorization, or gold-label reliability.&lt;/p&gt;

&lt;p&gt;The 3080-row BANKING77 predictions were generated from saved int8 logits and frozen temperature 0.75 by the earlier work; prediction-metric-desk audits that saved result. It gives 2779 correct and 301 incorrect while retaining the original seven normalized train/test overlaps. The tool does not regenerate logits, fit a temperature, or perform new calibration. That is not new training, inference, blind evaluation, or generalization evidence. The implementation and synthetic fixture are Apache 2.0. The BANKING77 source data and derived outputs stay CC BY 4.0 with attribution to PolyAI and Casanueva et al. 2020.&lt;/p&gt;

&lt;p&gt;By Renchao Wu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/prediction-metric-desk-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>testing</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>A three-state label queue where 100% reviewed and 0 labels can both be true</title>
      <dc:creator>十方空烬 · Ember ☄️</dc:creator>
      <pubDate>Fri, 13 Nov 2026 05:36:09 +0000</pubDate>
      <link>https://dev.to/widechaos/a-three-state-label-queue-where-100-reviewed-and-0-labels-can-both-be-true-2jg9</link>
      <guid>https://dev.to/widechaos/a-three-state-label-queue-where-100-reviewed-and-0-labels-can-both-be-true-2jg9</guid>
      <description>&lt;h2&gt;
  
  
  Why one boolean is not enough
&lt;/h2&gt;

&lt;p&gt;A common first draft for a local annotation or review queue adds a &lt;code&gt;done&lt;/code&gt; boolean to every record. It becomes true when someone looks at the record and false before that. The problem appears at export time: the same field cannot say whether the record has a label. A record can be processed yet unlabelled, or unprocessed yet read downstream as finished. Separate two predicates first. &lt;code&gt;reviewed&lt;/code&gt; means the record has been handled, including giving a label or explicitly abstaining. &lt;code&gt;label_present&lt;/code&gt; means the record actually carries a label from the taxonomy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/local-label-queue" rel="noopener noreferrer"&gt;local-label-queue&lt;/a&gt; is a small public tool I made; the source and samples are downloadable. It uses three states instead of two booleans: &lt;code&gt;unlabelled&lt;/code&gt;, &lt;code&gt;labelled&lt;/code&gt;, and &lt;code&gt;abstained&lt;/code&gt;. The &lt;code&gt;label&lt;/code&gt; field holds a taxonomy string only when status is &lt;code&gt;labelled&lt;/code&gt;, and is &lt;code&gt;null&lt;/code&gt; in the other two states. The tool has no &lt;code&gt;done&lt;/code&gt; or &lt;code&gt;has_label&lt;/code&gt; boolean field. An external system that defines &lt;code&gt;done&lt;/code&gt; as reviewed makes labelled and abstained both true. One that defines &lt;code&gt;done&lt;/code&gt; as label_present makes abstained and unlabelled both false. The three states keep the gap between the two predicates.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the 12 synthetic records show
&lt;/h2&gt;

&lt;p&gt;The bundled &lt;a href="https://huggingface.co/spaces/WideChaos/local-label-queue/blob/d8068775077cd4149a39ec9a2c6cb0ab52045d54/demo-annotations.jsonl" rel="noopener noreferrer"&gt;demo-annotations.jsonl&lt;/a&gt; contains 12 records: 2 labelled, 1 abstained, and 9 unlabelled. Every non-labelled row has &lt;code&gt;label: null&lt;/code&gt;. Reviewed therefore counts 3, label_present counts 2, and the difference is the abstained row. Abstaining on every record gives a reviewed fraction of 1 while labelled stays 0. That shows abstention counts toward workflow progress but creates no label and implies nothing about label correctness. If a single boolean is defined as reviewed, it merges labelled with abstained. If it is defined as has_label, it merges abstained with unlabelled. Splitting the two questions keeps the legitimate state of 100% processed with zero labels from disappearing.&lt;/p&gt;

&lt;p&gt;The two lines below fetch the public sample and count it. The result should match the description above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -sL https://huggingface.co/spaces/WideChaos/local-label-queue/raw/d8068775077cd4149a39ec9a2c6cb0ab52045d54/demo-annotations.jsonl -o demo-annotations.jsonl
node --input-type=module -e 'const rows=(await import("node:fs")).readFileSync("demo-annotations.jsonl","utf8").trim().split("\n").map(JSON.parse);const c=rows.reduce((a,r)=&amp;gt;(a[r.status]=(a[r.status]||0)+1,a),{});console.log(c, rows.filter(r=&amp;gt;r.status!=="labelled"&amp;amp;&amp;amp;r.label!==null).length)'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output should include &lt;code&gt;{ labelled: 2, abstained: 1, unlabelled: 9 }&lt;/code&gt;, with zero non-labelled rows whose &lt;code&gt;label&lt;/code&gt; is not null. This checks state modeling and export fidelity. It does not check label correctness because the sample is original synthetic material, not human annotation or a gold standard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/static/assets/projects/local-label-queue-hf-running-0447faff00b2.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiebg6nmaopbqcnqok91u.jpg" alt="local-label-queue running in a Hugging Face Space" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This screenshot shows the public Space I deployed, displaying the same 12 synthetic records: 2 labelled, 1 abstained, and 9 unlabelled, with reviewed near 25% including the abstention. That share measures queue progress only; it says nothing about label correctness. The page also has no autosave.&lt;/p&gt;

&lt;h2&gt;
  
  
  revision and checkpoint serve different purposes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/spaces/WideChaos/local-label-queue/blob/d8068775077cd4149a39ec9a2c6cb0ab52045d54/demo-checkpoint.json" rel="noopener noreferrer"&gt;demo-checkpoint.json&lt;/a&gt; uses the same inventory and still shows 2/1/9, but its &lt;code&gt;revision&lt;/code&gt; field is 7. revision counts changes, including undo operations. It is neither a processed count nor a labelled count. Reading it as completion progress creates false numbers.&lt;/p&gt;

&lt;p&gt;The checkpoint is for resuming. The tool keeps decisions only in page memory; it has no autosave, browser storage, or cloud sync. Download the checkpoint explicitly before a refresh. On restore, it verifies the inventory hash and content hash, shows a preview, and replaces the current state explicitly rather than merging. JSONL export keeps every original group and text, not only labelled rows, so review all records before sharing the file with someone else.&lt;/p&gt;

&lt;p&gt;SHA-256 is a recomputable consistency check. It detects a changed or truncated file but proves nothing about origin, label truth, or encryption, and it cannot stop someone from repacking a file after verification.&lt;/p&gt;

&lt;p&gt;Use and source: &lt;a href="https://widechaos-local-label-queue.static.hf.space/index.html" rel="noopener noreferrer"&gt;Live app&lt;/a&gt; · &lt;a href="https://huggingface.co/spaces/WideChaos/local-label-queue/tree/d8068775077cd4149a39ec9a2c6cb0ab52045d54" rel="noopener noreferrer"&gt;Pinned source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author: Renchao Wu&lt;/p&gt;

&lt;p&gt;&lt;a href="https://widechaos.cn/blog/local-label-queue-en" rel="noopener noreferrer"&gt;English original&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>javascript</category>
      <category>testing</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
