DFilterForge Retrospective 06: Every number has a source, yet one digit was still missing on a phone

The DFilterForge site forbids hand-written numbers: every value on a page carries its provenance, pointing to a location in a committed file in the repository, and a test recomputes it independently. This post tells how that chain came to be and the holes it had: a check that only recognized ASCII digits, numbers that existed only in server-rendered HTML, two values swapped, a formatting function shared with the page, and the one time the text was all correct but the pixels were wrong: on a 320 px phone, a real bill read as USD 0.2. Finally, the unreproducible README animation and a few deployment traps.

Published
Reading time
17 min read
Category
Retrospectives
Tags
Translated from
the Chinese original
Contents9 sections

This is the sixth post in the DFilterForge retrospective (series overview). Most of the numbers in the earlier posts also appear on the project’s site. The site’s hardest rule is this: no hand-written numbers on a page. Every value must carry its provenance, pointing to a location in a committed file in the repository, and a test recomputes it independently.

This post first tells how that rule came to be, then its several holes, and one time the text was all correct but the pixels were wrong. Finally, the animation in the README and deployment. The numbers in this post mostly come from committed records in the repository1; a few were counted from the live pages, and the post says so where that is the case.

What the site looks like

The site is statically exported, built in Docker, and both the data export and next build steps run without network access. The header says “Recorded results only. This site never calls a model.”: the pages only show committed run records and never call a model themselves.

A screenshot of the opening of DFilterForge's Methodology page. The header has DFilterForge, Wireshark display filter benchmark and by WeiGuang-2099 on the left, and the navigation Reel, Board, Training, Exhibits, Methodology, Source on the right, with a smaller line below reading Recorded results only. This site never calls a model. The main heading is Evidence has a boundary., followed by a paragraph of explanation. The first section, Prompt conditions, is a table: C1 and C2 have the answer form display_filter, C3 and C4 have typed_ir; C1 and C3 do not retrieve fields, C2 and C4 use lexical retrieval; below the table it says Field retrieval lists at most 16 catalog fields per request. The second section, Probe captures, lists 8 probes from semantic-11 to semantic-35, each row with split, role, benchmark frames, all frames, and the capture SHA-256 truncated to 12 characters. The numbers in the table are underlined. The last paragraph says the first probe contains 33 witness packets.
Figure 1: The opening of the Methodology page. Every underlined value in the table is a link to the committed file it was read from.

A few other design decisions:

  • A model’s output is untrusted content. Answer text is shown at most 4,096 UTF-8 bytes, truncated on a character boundary; it is inserted only as a text node, and the lint forbids dangerouslySetInnerHTML by name; invisible code points are marked explicitly.
  • No ranking. Models appear in a fixed order, not ranked by score.
  • Color. A cool paper background, and exactly one carmine across the whole site (#b3203e in light mode), used to mark things that were disproved or failed.
  • The homepage example is chosen by a rule. The trace on the homepage was selected by the rule reel-v1, registered on October 1, before any test answers existed. The candidates were 54 C4 silent-wrong answers, and only this one had 3 frames in total that disagree with the labels, one on each of the three scoring probes; the next fewest among the rest was 4 (web-site.md).

Hand-written numbers go stale

Before September 15, the benchmark, ablation, receipt and workbench pages all had hand-written numbers. A commit that day deleted them all, with a commit message saying they included “a training result that never ran” (aa3cac8). One of the deleted tables had a row SFT + typed IR with 67/80 in the exact column, at a time when no training run had ever happened.

The same commit added a sentence to /methodology:

No language model has been evaluated or trained yet; the Evaluate page shows hand-written example data until the first committed model run replaces it.

That sentence itself was hand-written. After the first model scoring was committed on September 23, it was no longer true. The commit that removed it on October 1 says “so that sentence is false” (52c9a37).

This shows that it is not only numbers that go stale. A sentence describing the project’s current state, such as “no model has been evaluated yet”, goes stale just like a hand-written number, and is harder to notice.

A chain from file to pixel

On October 1, the site was changed to the following chain (3df8722, e1272c2, fc0ee7e, 07d91ca):

  1. The exporter. A Python script reads every value a page needs out of the committed record files. Each value is a node that carries its provenance: a string is {"t": text, "src": op}, and a number, boolean or integer array is {"v": value, "src": op}. The op says which bytes the value is read from and how; the common kinds are:

    • ptr: a JSON Pointer into a JSON file;
    • row: the row in a JSONL file whose key matches;
    • count, len, sum: a count, an array length, a sum of integers;
    • sha256: the hash of the file itself.

    The exporter obtains each value by parsing the value’s own src, so a value can never be separated from its provenance. The design record also says: the site never divides (web-site.md).

  2. Components. Pages can only display values through components like <Num> and <Str>, which write the provenance into the HTML. The 16 in Figure 1 looks like this in the live HTML (the &quot; in attributes is replaced with single quotes, and line breaks added):

    The 16 on the Methodology pageHTML
    <a class="num" href="https://github.com/WeiGuang-2099/DFilterForge/blob/09bb5372a00f91b3536f82185d05dd11100ac0a9/docs/results/dev-qwen3-32b-2026-09-26/prepare.json">
      <data data-fmt="int"
        data-src='["ptr","docs/results/dev-qwen3-32b-2026-09-26/prepare.json","/top_k"]'
        data-v="16" value="16">16</data>
    </a>
  3. The digit lint. Any digit appearing in markup is an error, with the message: “A digit in markup is a hand-written number.” Fixed names containing digits go through <Term>; the whitelist had only IPv4 and SHA-256 at first, and even by November 9 it had only four, the later additions being repair@1 and the author’s GitHub username. Even C4 cannot be written directly; the “C4” on the page is read from the run records.

  4. The consistency test. Every route of the built site is opened. Every value on the page with a data-src is recomputed from the original files by a separate TypeScript parser, whose comment says it “shares no code” with the Python exporter; any text on the page that looks like a number but has no provenance fails the test.

  5. CI. All of the above run in CI.

That evening, /methodology had 138 values with provenance (fc0ee7e), and the Playwright tests went from 2 to 57. By the November 9 version, counting from the live HTML, this page has 1,371 elements with data-src.

The holes in the chain

After the chain was built, review kept finding holes, all of the same shape: the checks were green, but the page could still be wrong. Most of these were not actual mistakes on the live site, but a wrong page planted during review, or an imagined change, proving the tests could not stop it.

Only ASCII digits. Review that same evening found that both the lint and the consistency test’s scan only recognized [0-9], and neither looked at a list’s start attribute. Full-width digits, Roman numerals, or <ol start={56}> could all appear on the page, “with lint, build and all 57 end-to-end tests green”, even though the docs said a hand-written number could not pass either check. Both sides were changed to Unicode \p{N}, and the start attribute was included too (3d3342c).

The checker believed the page’s own word. The truncation length for model answers was originally compared against the data-cap marked on the page, so the page only had to mark a matching length and it “passed every check”. It was later changed to take the limit from the data contract, not from the page (28efe20).

Numbers only in the server HTML. The test originally scanned the page after hydration. If a client component carried a hand-written number in the server HTML and deleted it during hydration, the scan would never see it, yet “every visitor without JavaScript, every crawler and every first paint saw it”. The test had also compared the server HTML and the post-hydration data-src sets, but a hand-written number has no data-src at all, so it could never be in the set (5048d0e).

The fix was to scan every route again in an environment with JavaScript disabled, rerunning the same three checks. The test plants a page: the HTML says “Seventy-eight: 78 runs”, and a script deletes it after loading. The post-hydration scan finds nothing; the no-JS scan catches it. The cost is that each route’s test time went from 0.7–0.9 seconds to 0.9–1.6 seconds.

Each value is only checked against its own provenance. On October 4, a row on /methodology said “Repair round: not measured yet”, without saying which split’s repair round; the dev split’s repair round had already been measured, so a reader would think no repair round had been measured at all. The fix was to add “Test” or “Dev” to the row, with the label itself also read from the /split of the referenced run record. While making this fix, several mutant versions were built on a temporary copy: the label taken from another run, or a hand-typed “Test repair round”. All of them passed the value checks (dfeaf11).

Review on November 9 found the same class of problem again, this time on /training. The original words were “The value checks hold each node to its own pointer only”: each value is only compared with its own provenance, so putting a bill where a GPU cost belongs, or swapping the silent-wrong and invalid columns, still shows committed numbers, just under the wrong captions, and the tests are still green. The fix was to pin positions down: the intro, paragraphs and notes of the cost section are read in order, the table is read cell by cell against its header, and each column’s header is bound to the key it reads. The commit says that, with JavaScript off, swapping two values wholesale in the built page makes the new test fail, while the same swap passes the value checks (69228cc).

In another commit the same day, review found three more things on /training that no test read at all (d3528f7):

  • The repair-round squares, the widths of the bar segments and the positions of the interval ticks had never been checked against the counts and endpoints they draw. Now every failed answer sent to repair draws one square, with the repaired ones filled first; each bar segment is widened by the count it represents; the ticks must land on the endpoints in the summary;
  • A step whose interval lay entirely above 0 could pass the old test even if it was read as a “loss”;
  • The exact amount shown on hover is written in a title attribute, but the scan skips the attributes of values with provenance, so it had never been compared with the files.

A formatting function shared with the page. Values on the site are formatted only by lib/fmt.ts, and rounded on decimal places, never on the binary float. For example, 0.6375: toFixed gives 0.637, while the site shows 0.638 (a0157eb). But the consistency test formats with the same fmt.ts. If the formatting function is wrong, the test is wrong along with it. So whether the rounding is right can only be guarded by hand-written expected values in unit tests. When a format for rounding amounts to cents was later added, the commit message said these hand-pinned expectations are “the one guard on the rounding itself” (90fabb8). The set for rates looks like this:

apps/web/tests/fmt.spec.tsTypeScript
test('rate rounds the committed decimal to three places, halves away from zero', () => {
  // The cases locked-test-v1.md shows: a summary's six places, rounded on
  // the decimal digits, never on the binary float, which toFixed would.
  expect(fmt(0.6375, 'rate')).toBe('0.638');
  expect(fmt(0.8125, 'rate')).toBe('0.813');
  expect(fmt(-0.0625, 'rate')).toBe('-0.063');
  // …
});

The text was all correct, the pixels were wrong

The incident in the title happened on the evening of November 9, before PR #50 was merged. That afternoon, the /training page gained a section about costs (4384ff7), with a table, “Each session’s Modal bill”, listing the three sessions that ran models on Modal: date, requests, GPU hours, bill, and a final column of notes. The three bills were USD 0.27, USD 0.27 and USD 0.61.

The first commit found that on a phone the bills in this table were invisible: the notes column sat second, with a minimum width of 13rem, pushing the requests, GPU hours and bill columns out of the frame, and on a 320 px screen there was no hint that the table could scroll horizontally. The fix was to move the notes column last. The commit message says that, at 320 px, the edge of the bill cut by the frame’s border is itself a hint that “this table scrolls” (f22c9c2).

Thirteen minutes later, another commit recognized that this “hint” was actually a wrong number:

With the words column moved last, the four number columns need about 313 px, so on a 320 px phone the bill, the table’s last number, was cut mid-digit at the wrapper’s edge and read as USD 0.2.

The four number columns need about 313 px, and on a 320 px phone the bill was cut through the middle of a digit by the frame’s edge, reading as USD 0.2. The fix was to reduce the gap between cells from 14 px to 8 px at 360 px and below (20ef754):

apps/web/app/_components/training/training.cssCSS
/* On the narrowest phones the cost table's cells sit closer, so the bill,
   its last number, stays whole in view and the words after it scroll. */
@media (max-width: 360px) {
  .tr-cost-table th, .tr-cost-table td {padding-right: 8px;}
}
A screenshot of DFilterForge's Training page at 320 px wide. The subheading What these runs cost, the large text USD 1.03 per thousand requests, and a paragraph below: 1121 requests, 3 sessions, bill USD 1.15, and so on. Below that is the table Each session's Modal bill, with columns Session, Requests, GPU hours, Bill, and a fifth column showing only the first letter W of its header. The three rows are 2026-10-28, 442, 0.107335, USD 0.27; 2026-10-31, 375, 0.235382, USD 0.27; 2026-11-05, 304, 0.644036, USD 0.61. The notes in the fifth column are cut off at the right edge.
Figure 2: The cost table at 320 px, after the fix. The three bills stay whole inside the frame; what the frame's edge cuts off is the column of words after them.

Both fixes landed before PR #50 was merged, so the live site never displayed it this way. But both times, the existing tests could not see it:

  • The page’s text was right. The DOM said “USD 0.27”; the value checks and provenance checks were all fine. Only the pixels the user saw were wrong.
  • The width test only checks that the whole page does not scroll horizontally at 320 and 400 px, comparing the page’s scrollWidth and clientWidth. The table scrolls inside its own frame, which does not count as the page being too wide, so it could see neither the truncated bill nor the invisible one.
  • The fixing commits added no tests either.

There were several more of the same kind:

  • The hashes in the probe table. The probe table in Figure 1 is a 438 px table on a 390 px phone, sitting in a 358 px frame, leaving only four of the 12 hash characters visible, with no hint of scrolling. Later, on narrow screens the hash was put on its own line (c1f2fd1).
  • One selector hid two words. The “no case exact” and “every case exact” at the two ends of the scale on /training were both hidden by a descendant selector at 760 px and below. Adding a > to select only direct children fixed it (e5e76e3).
  • An iPad in portrait. At widths around 761–860 px, the INCONCLUSIVE label collided with the adjacent 0.088 and 0.100; the breakpoint was moved to 960 px (efe727e).
  • A dot covered an interval. On a phone, a 12 px dot covered the entire interval from 0.000 to 0.063 on the schema step (ac40550).
  • Touch target size. At 390 px, the header links’ text was only 12 px, and the tap targets were too small and too close together, failing axe’s target-size check (WCAG 2.5.8); they were all changed to at least 24 px tall (207d03e). This rule is off by default in axe; the homepage test explicitly carries the WCAG 2.2 tag, which is how this was found.
  • Overlapping labels. The homepage ladder chart’s row height was 20 px, but the labels needed about 25 px. The row height was changed to 24 px and the arrows’ drop was cut from 12 px to 6 px, and a new test found 26 pairs of overlapping labels on the old geometry (4fe44f4).

The animation in the README

At the top of the README there is an animation recording the homepage, in three segments: first the top of the page; then tshark sweeping over a probe, stopping at frame 60, the one that disproves that answer; finally the repair round.

The earliest recording script froze the page’s clock, with a commit message saying “one build gives the same frames every run” (7f4eb33). Yet recording the same build twice, 81 of the 150 frames differed:

  1. The sweep’s starting point was read from performance.now() under the frozen fake clock. The fix was to anchor the clock to the first animation frame (b656bbd, d58ca05).
  2. Once the clock was fixed, the second cause surfaced: the rotated labels, because rasterization is multithreaded, differed by one or two levels per color channel. The fix was to make Chromium use a single raster thread and disable the GPU (d58ca05).

After that, three recordings produced 80 identical frames.

Next was the window height. After the ladder chart’s row height was increased as described above, the chart was 1,066 px tall, and a 1000 px window cut it off before frame 60, so the window was changed to 1100 px (5994ec7). The final animation has three scenes, 135 frames, 10 frames per second, 13.5 seconds, 800×696, 719,785 bytes, encoded with ffmpeg 7.1 in Docker (ccd4093).

Reproducible is not the same as current. This animation was recorded on October 7 and never touched again; since then the navigation bar gained Training, Exhibits and Source, and the header gained the author’s name, but the first frame of the animation still shows the old navigation bar with only Reel, Board and Methodology.

Deployment

The site is deployed on GitHub Pages, with the path prefix /DFilterForge. There are a few traps here:

  • A fork deploys too. Deployment originally only required a push to main. Before the repository went public, another condition was added: only run in this repository. Otherwise, when someone forked and synced main, the deployment job would run too. At the time it still deployed to Cloudflare Pages, where it would fail at the step that checks the secret, or use the fork owner’s own secret and upload to their account (a87f777). After the move to GitHub Pages, this condition stayed.

  • The path prefix is baked in at build time. Next inlines basePath at build time. A site built for a different prefix passes all its own tests, and after going live every asset is a 404. So CI checks that out/index.html contains ="/DFilterForge/_next/static/ (81dc7a8). The default value of this prefix is written in four places; changing only the one in the module “left CI green on the old prefix”. A test was later added pinning the other places to match the module (a9f12d9).

  • The CDN’s cache. Pages returns max-age=600, and the CDN also ignores the query string, so visiting right after a deploy may get the old page, with status 200. A go-live check that only accepts 200 would go green on the old deployment. Fortunately, every page links its provenance to the commit it was exported from, so the go-live check looks for this commit hash:

    .github/workflows/ci.ymlYAML
    for attempt in $(seq 20); do
      if curl --fail --silent --show-error --output "$page" \
          "$site/DFilterForge/methodology/" \
          && grep -q "/blob/$GITHUB_SHA/" "$page"; then
        break
      fi
      test "$attempt" -lt 20
      sleep 30
    done

    It waits at most ten minutes, longer than the 600-second cache; once found, it fetches one static asset to confirm it loads.

  • Exporting on Windows. Seen on Next 16.3.4: when exporting on Windows, nested prefetch file paths are joined with the system’s path function, so the files land in subdirectories, while the client requests the flat Linux-style file names, so a site built on Windows gets 404s for these requests. The smoke test exempts this one case, and both CI and Pages use Linux builds.

  • The output directory is not cleared automatically. Docker’s --output type=local does not clear the destination directory. Once, when measuring size, an old build left 3 manifest files behind, giving 32 files instead of 29. The animation recording script also clears the frame directory before recording.

What is still unguarded

As of November 9, the chain still had a few known gaps:

  • Prose has no provenance. The last section of /methodology still says “Benchmark and ablation pages retain failures and inconclusive outcomes.”, but the benchmark and ablation pages were deleted on September 15. This sentence contains no number and has no provenance; neither the lint nor the scan can see it. It is the same kind of problem as the opening “No language model has been evaluated”.
  • Blind spots the design record itself lists. The consistency test does not scan CSS content:, meta tags in <head>, or list numbers generated by CSS; amounts are also not bound to a format like usd.
  • The case pages and receipt pages are not built yet. The design record says Pages has a 1 GB limit and no file count limit, enough for the future receipt pages.

Summary

  • A sentence describing the project’s state is also a hand-written number, and goes stale just the same;
  • A value matching its provenance does not mean it is in the right place. Labels, positions and graphics all need to be pinned separately;
  • Checks must look at every form a reader can see: the HTML with JavaScript off, the pixels on a narrow screen;
  • A test cannot vouch for code it shares with the page; hand-written expected values are needed separately;
  • A checker must not believe the page’s own word; limits and lengths should come from the data contract;
  • A go-live check that only accepts status 200 will go green on an old deployment; look for this commit’s fingerprint;
  • A reproducible artifact also goes stale.

The series overview, and the ten pitfalls most worth reading, are in post 00.

Footnotes

  1. The repository is WeiGuang-2099/DFilterForge. The source and docs linked in this post are all pinned to the commit 09bb537 of November 9, 2026. ↩︎