<?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: Xuefeng Zhu</title>
    <description>The latest articles on DEV Community by Xuefeng Zhu (@xuefengzhu).</description>
    <link>https://dev.to/xuefengzhu</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%2F4222671%2F5599608a-2193-4250-a8a5-da635b6ac8e2.jpg</url>
      <title>DEV Community: Xuefeng Zhu</title>
      <link>https://dev.to/xuefengzhu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xuefengzhu"/>
    <language>en</language>
    <item>
      <title>The $6,000 decline was right. The Explain button was broken.</title>
      <dc:creator>Xuefeng Zhu</dc:creator>
      <pubDate>Thu, 26 Nov 2026 06:58:34 +0000</pubDate>
      <link>https://dev.to/xuefengzhu/the-6000-decline-was-right-the-explain-button-was-broken-1h2g</link>
      <guid>https://dev.to/xuefengzhu/the-6000-decline-was-right-the-explain-button-was-broken-1h2g</guid>
      <description>&lt;p&gt;In my Clause Hybrid demo, I simulated a $6,000 charge on a contractor’s virtual card. The contract had released only $4,000, so the card declined the charge under §1.1. Then Kane CLI clicked &lt;strong&gt;Explain&lt;/strong&gt;. The app opened an empty chat, and the runner eventually crashed while waiting for an answer.&lt;/p&gt;

&lt;p&gt;The payment rules did their job. A customer looking at the screen still had no way to understand the decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the decision and the explanation
&lt;/h2&gt;

&lt;p&gt;I built Clause Hybrid to turn a contractor’s quote into rules for a virtual card. The sample quote totals $12,000 across three milestones. The first $4,000 is available on signing. Later releases require reviewed proof and owner approval. The model can extract terms and draft explanations. Deterministic rules decide whether a charge is allowed and whether funds can be released.&lt;/p&gt;

&lt;p&gt;I used four plain-English Kane CLI flows to exercise quote parsing, an over-limit charge, a change order, and a rejected proof photo. I checked the offline quote-reading behavior separately in Chrome DevTools.&lt;/p&gt;

&lt;p&gt;Hark used the original Kane browser observations to move the explanation inline and add a check against invented amounts and payment promises. In the passing rerun, the charge still showed as declined under §1.1, the explanation showed up beneath it, and the released amount stayed at $4,000. &lt;a href="https://github.com/Xuefeng-Zhu/clause-hybrid/commit/22daf676" rel="noopener noreferrer"&gt;Product fix&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The photo flow taught me something different. The first check passed because the release button stayed disabled, even though the screen said &lt;strong&gt;“Proof received”&lt;/strong&gt; and displayed &lt;strong&gt;“+$5,000.”&lt;/strong&gt; I tightened the test to require &lt;strong&gt;“Proof rejected”&lt;/strong&gt; and &lt;strong&gt;“$5,000 stays locked.”&lt;/strong&gt; Now it checks the state and what the owner sees.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Kane failed on the test itself
&lt;/h2&gt;

&lt;p&gt;On November 24, three of four flows passed on the first run against a local build using deterministic fixtures. The quote flow had already checked the amounts, deadline, and release state. Kane then turned a vague closing sentence into a checkpoint with no texts to check.&lt;/p&gt;

&lt;p&gt;The runner wrote Kane’s output to &lt;code&gt;kane/out/FAILURES.md&lt;/code&gt;. Codex read the report and removed that one sentence, preserving every explicit assertion. Kane reran just the quote flow on a fresh store and browser profile, and it passed. &lt;a href="https://github.com/Xuefeng-Zhu/clause-hybrid/commit/db51d20" rel="noopener noreferrer"&gt;Test change&lt;/a&gt; · &lt;a href="https://github.com/Xuefeng-Zhu/clause-hybrid/blob/main/docs/KANE.md#run-4-a-full-run-and-a-real-failuresmd-hand-off-nov-24" rel="noopener noreferrer"&gt;Kane results&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I now write the exact UI state I expect to see, especially when a button is disabled or a payment is held. What would you check next in this workflow?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Xuefeng-Zhu/clause-hybrid" rel="noopener noreferrer"&gt;Source and local setup&lt;/a&gt; · &lt;a href="https://www.kaneclihack.sh/o/p/xuefeng-zhu" rel="noopener noreferrer"&gt;Hackathon showcase&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI using the project’s code, demo, and documented test runs.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>playwright</category>
      <category>agents</category>
    </item>
    <item>
      <title>I built a practice room for the commitments that fall between teams</title>
      <dc:creator>Xuefeng Zhu</dc:creator>
      <pubDate>Sat, 07 Nov 2026 16:58:25 +0000</pubDate>
      <link>https://dev.to/xuefengzhu/i-built-a-practice-room-for-the-commitments-that-fall-between-teams-52ki</link>
      <guid>https://dev.to/xuefengzhu/i-built-a-practice-room-for-the-commitments-that-fall-between-teams-52ki</guid>
      <description>&lt;p&gt;A customer expects an integration on Friday. Sales wants an answer. Engineering says the work cannot ship by then. What should happen next?&lt;/p&gt;

&lt;p&gt;The hard part is often not finding the perfect sentence. It is noticing that several different statements are being treated as one promise: a customer expectation, an engineering target, a proposed follow-up, and an agreement that nobody has actually made.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;Commitment Lab&lt;/strong&gt; for the Flip the Switch hackathon as a personal practice space for navigating that kind of conversation. The learner works through a fictional stakeholder conflict with an engineering mentor and two AI agents in a shared Switch room. The goal is to leave with a clearer picture of what has been agreed, what is only proposed, and what remains open.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://youtu.be/Zlj0oDvXb-Y" rel="noopener noreferrer"&gt;Watch the demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Xuefeng-Zhu/commitment-lab" rel="noopener noreferrer"&gt;Explore the repository and setup instructions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A conversation with four roles
&lt;/h2&gt;

&lt;p&gt;The exercise begins with a fictional company, Acme, and a Friday launch expectation. There are four roles in the lab:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Learner:&lt;/strong&gt; asks questions, surfaces the conflict, and proposes a next step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stakeholder agent:&lt;/strong&gt; plays Sales, responds to the engineering constraint, and represents what Sales can do next.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engineering mentor:&lt;/strong&gt; provides the feasibility constraint and can confirm or revise the engineering part of a proposal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coach agent:&lt;/strong&gt; reads the room and produces a debrief and commitment record.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the recorded exercise, one operator simulated both the learner and the mentor. The stakeholder and coach were Codex-backed agents running in a real Switch and Mattermost setup. The scenario and customer are fictional. A second, independent mentor joining the room has not yet been verified.&lt;/p&gt;

&lt;p&gt;That distinction matters. The design aims to make a human mentor part of the loop, but the demo proves a single-operator role-play with two agents, not independent mentor access or a validated training outcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why put the exercise in Switch?
&lt;/h2&gt;

&lt;p&gt;I wanted the constraint and the response to meet in the same conversation. The Sales agent should be able to react after the mentor explains what engineering can deliver. Later, the coach should review the messages that actually occurred, including the uncertainty and any correction, instead of evaluating a polished answer assembled after the fact.&lt;/p&gt;

&lt;p&gt;Switch connects the agents to the Mattermost channel and gives the participants shared room context. The project includes an importable template that creates the stakeholder and coach agents and a room. Their instructions define different responsibilities: the stakeholder advances the conversation as Sales, while the coach looks for evidence in the round and separates commitments from open questions.&lt;/p&gt;

&lt;p&gt;This implementation depends on the Switch room for its handoffs. That does not mean a single agent with the right integrations or another multi-person system could never support a similar exercise. Switch makes this particular arrangement of people, agents, chat, and shared history practical to build.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened in the recorded round
&lt;/h2&gt;

&lt;p&gt;The stakeholder asked whether the full Acme integration was committed for a Friday launch. The simulated learner asked engineering what was feasible. The simulated mentor responded that neither a CSV export nor the full integration could ship before May 22.&lt;/p&gt;

&lt;p&gt;After that constraint appeared, the stakeholder acknowledged that Sales could not confirm the earlier launch. The learner proposed that Sales ask Acme whether it could delay, with May 22 presented as engineering's target. Sales accepted the customer follow-up; the simulated mentor confirmed the target while making clear that engineering could not accept a new launch date on Acme's behalf.&lt;/p&gt;

&lt;p&gt;That last distinction is the learning point. A target is not a customer-approved commitment. A Sales promise to ask a question is not the customer's answer. The coach was asked to preserve those differences in its debrief.&lt;/p&gt;

&lt;p&gt;There was also a brief offline-or-reconnecting notice before the stakeholder replied. I can say that the notice appeared and that a reply followed; the recording does not establish the details of a reconnection. Clearer agent availability feedback would make this kind of handoff easier to understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  The coach made a mistake worth keeping in the demo
&lt;/h2&gt;

&lt;p&gt;The recorded debrief correctly kept customer acceptance unresolved, but it also listed Engineering as the CSV export owner even though no one had explicitly assigned that owner. It asked who would return the customer answer even though Sales had already said it would bring the response back.&lt;/p&gt;

&lt;p&gt;Those are useful reminders that a plausible-looking summary can quietly turn an inference into a fact. The coach's output needs human review against the room. It is feedback for practice, not a reliable source of professional assessment or an authoritative commitment ledger.&lt;/p&gt;

&lt;p&gt;After the coach instructions were refined, the workflow was checked in a targeted follow-up using labeled, simulated role messages. In that one check, the coach left the CSV owner unstated, attributed the simulated roles correctly, and kept customer acceptance unresolved. That's an encouraging observation, not proof that the issue is solved: model output varies, and the follow-up was not an independent mentor session. The repository includes the &lt;a href="https://github.com/Xuefeng-Zhu/commitment-lab/blob/main/evidence/round-d-transcript.md" rel="noopener noreferrer"&gt;recorded round&lt;/a&gt; and &lt;a href="https://github.com/Xuefeng-Zhu/commitment-lab/blob/main/evidence/check-f-transcript.md" rel="noopener noreferrer"&gt;targeted follow-up&lt;/a&gt; so others can inspect the difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the workflow
&lt;/h2&gt;

&lt;p&gt;The repository contains the ready-to-import Switch template, editable agent instructions, a scenario, a debrief format, and setup notes. At a high level:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start or connect Switch Console to a Switch server, configure a chat bridge, and have a supported agent provider installed and authenticated.&lt;/li&gt;
&lt;li&gt;Import &lt;code&gt;commitment-lab.template.yaml&lt;/code&gt; under &lt;strong&gt;Templates → Import template&lt;/strong&gt;, then select &lt;strong&gt;Use&lt;/strong&gt; and provide a short prefix, bridge, provider, and working location as needed.&lt;/li&gt;
&lt;li&gt;Confirm the room and channel settings, bring both agents online, and add a mentor with the access required by your deployment. If one person plays both roles, label the mentor messages as role-play.&lt;/li&gt;
&lt;li&gt;Start the Friday exercise by addressing the stakeholder agent. Ask the mentor about feasibility, invite the stakeholder to respond, and propose a conditional next step.&lt;/li&gt;
&lt;li&gt;Address the coach agent for a debrief, then compare its commitment record to the actual messages—especially owners, dates, and customer acceptance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;a href="https://github.com/Xuefeng-Zhu/commitment-lab#readme" rel="noopener noreferrer"&gt;README&lt;/a&gt; has the full prerequisites and caveats, including remote-server access and how to regenerate and check the template. A private room is not a substitute for reviewing permissions; agent instructions are not a security sandbox. Use fictional information rather than real customer data or credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would improve next
&lt;/h2&gt;

&lt;p&gt;The first priority is to test a genuine second-person mentor handoff, including the actual channel and Switch access that person needs. I'd also like to make the coach's evidence trail easier to inspect and make missing owners and unconfirmed customer decisions harder to overlook. Finally, clearer online and reconnecting status would help participants distinguish a delayed agent from a completed handoff.&lt;/p&gt;

&lt;p&gt;The exercise is deliberately small. Its value is in making a familiar workplace ambiguity visible, letting someone practice the next conversation, and showing where an AI-generated record still needs a person to check it.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Build and media disclosure:&lt;/strong&gt; I used Codex and other AI assistance while developing the workflow and materials. The agents in the recorded exercise were Codex-backed. The demo uses screenshots from the recorded run, an illustrative animated pointer, and synthetic narration generated through OpenRouter; it is not continuous live footage.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>agents</category>
    </item>
    <item>
      <title>Chasing milliseconds in Speed Demon 2026: lessons from a solo optimisation sprint</title>
      <dc:creator>Xuefeng Zhu</dc:creator>
      <pubDate>Mon, 02 Nov 2026 15:41:57 +0000</pubDate>
      <link>https://dev.to/xuefengzhu/chasing-milliseconds-in-speed-demon-2026-lessons-from-a-solo-optimisation-sprint-1l8i</link>
      <guid>https://dev.to/xuefengzhu/chasing-milliseconds-in-speed-demon-2026-lessons-from-a-solo-optimisation-sprint-1l8i</guid>
      <description>&lt;p&gt;The change I'm proudest of from this contest brought Track A's board memory down from 22.69 MB to 19.69 MB, with similar wall time. The change I was surest about looked faster on my test VM. On the real scoring machine its two runs averaged about 40% slower than the control, and I threw it away the same morning.&lt;/p&gt;

&lt;p&gt;I entered &lt;a href="https://speeddemon.dev/" rel="noopener noreferrer"&gt;Speed Demon 2026&lt;/a&gt;, organised by &lt;strong&gt;Hackathon Raptors&lt;/strong&gt;, as team &lt;strong&gt;PeppaPig&lt;/strong&gt;, a team of one. I wrote all four tracks in Rust with no crates, only the standard library. This post is about my method, and the many times my own measurements lied to me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The contest and the score
&lt;/h2&gt;

&lt;p&gt;There are four tracks. Each is a small, well-defined data job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A: Ingest&lt;/strong&gt;: parse a request log and write per-hour, per-endpoint latency summaries with percentiles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;B: Index&lt;/strong&gt;: tokenize a document corpus and answer phrase and boolean queries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;C: Join&lt;/strong&gt;: join a quoted CSV of records against a region table and aggregate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;D: Traverse&lt;/strong&gt;: build a weighted graph and answer shortest-path queries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every output has to be &lt;strong&gt;byte-identical&lt;/strong&gt; to the organisers' Python reference. Correctness is a gate, not a score component. Pass it, and you get a single number, K, built from reference-to-submission ratios for time, memory, source size and dependencies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;T&lt;/strong&gt;, wall time (exponent 0.5). This is the big one. The board takes the mean of the middle 3 of 5 runs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;M&lt;/strong&gt;, peak cgroup memory (exponent 0.2), taking the highest peak across the five runs. Output written to the tmpfs &lt;code&gt;/out&lt;/code&gt; counts against you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;S&lt;/strong&gt;, formatted code lines (exponent 0.15). That includes your Dockerfile.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;D&lt;/strong&gt;, 1 plus direct runtime dependencies (exponent 0.15). With no third-party runtime dependencies, my dependency factor was 1.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The memory ratio is capped at 50; the source and dependency ratios are capped at 1. Wall-time gains are uncapped.&lt;/p&gt;

&lt;p&gt;The scoring run gets 6 P-cores and 12 threads on an Intel i5-13500. The input is pre-warmed into the page cache, so the timings focus on warm-cache processing.&lt;/p&gt;

&lt;p&gt;S is subtle: while the source-size penalty applies, doubling S costs about 10% of K. Removing counted lines while preserving time and memory gives a predictable gain; a small measured speedup may disappear on the board.&lt;/p&gt;

&lt;p&gt;My best board K per track: &lt;strong&gt;A 47.32, B 34.36, C 41.77, D 27.59.&lt;/strong&gt; B's 34.36 came from the live board and is not yet in the repository log; the logged best for the submitted B code is 34.20.&lt;/p&gt;

&lt;h2&gt;
  
  
  The method
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Be honest about who did the typing
&lt;/h3&gt;

&lt;p&gt;A lot of the experimenting was done by AI coding agents (Hark, OpenAI Codex and Kiro) working side by side, with me directing. Each opened its own branches and pull requests, and every one had to beat production on the board like anything else. My job was to pick targets, set the rules of evidence, decide what shipped, and read every report. The agents worked in parallel on profiles, candidates, correctness checks and benchmark preparation. That let one person try far more ideas, and made a strict process vital: many plausible small wins in a night are a great way to fool yourself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Profile on hardware that looks like the box
&lt;/h3&gt;

&lt;p&gt;My laptop is ARM, so the serious work moved to an x86 cloud VM. I pinned the benchmarks to a fixed CPU set. Builds ran at low priority on separate cores. &lt;code&gt;perf&lt;/code&gt; highlighted hot instructions through sampling, and a cgroup harness read &lt;code&gt;memory.peak&lt;/code&gt; the way the board does.&lt;/p&gt;

&lt;h3&gt;
  
  
  One idea per agent, one lock per benchmark
&lt;/h3&gt;

&lt;p&gt;Each agent got one idea and its own directory. Every timed run took a shared file lock, so agents never benchmarked at the same time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Paired, interleaved, and repeated
&lt;/h3&gt;

&lt;p&gt;A candidate never ran against a number from yesterday. It ran in repeated pairs against the current production build, in alternating order and across input seeds. Track B used profile-guided optimisation (PGO), so there I compared multiple separately trained PGO builds per side.&lt;/p&gt;

&lt;h3&gt;
  
  
  The board decides
&lt;/h3&gt;

&lt;p&gt;The rule I settled on was to repeat promising candidates on the live board and judge them against a &lt;strong&gt;same-track control from the same period&lt;/strong&gt;, not against my best-ever run. Some obvious losses stopped after one run; noisy candidates needed more repetitions. If the evidence supported keeping a change, it became production. Otherwise it was reverted, and the reason went into a per-track &lt;code&gt;PERF.md&lt;/code&gt; log.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four wins
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Track A: redesigning the summary for memory
&lt;/h3&gt;

&lt;p&gt;Profiling left me looking for small gains in the parse, but memory became the cheaper target. The old summary copied each hour's latencies into a per-worker scratch buffer. The new one reuses an existing record vector and does an &lt;strong&gt;in-place counting sort&lt;/strong&gt; (American-flag style) to group records by endpoint in output order. Percentile selection happens within each group; the extra full-hour scratch buffer is gone.&lt;/p&gt;

&lt;p&gt;On the board, peak memory fell from the control's 22.69 MB to 20.44 and 19.69 MB, with similar wall time. It tied the control on its first run (45.97 vs 45.97, M −2.2 MB) and won the rerun with &lt;strong&gt;46.90&lt;/strong&gt;, at M 19.69 MB. It shipped.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Track B: a collision-free term table, then 16-bit result lists
&lt;/h3&gt;

&lt;p&gt;B spends most of its time tokenizing and looking up terms. The old linear-probe table could require multiple probes and unpredictable branches. The new version builds a &lt;strong&gt;hash-and-displace table&lt;/strong&gt; once, after parsing the queries, for query terms of at most 16 bytes. Those query keys get distinct slots; a lookup uses a 16-bit bucket displacement and an exact two-word key comparison to reject nonmembers. Longer terms still use a &lt;code&gt;HashMap&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On the board, production B had been sitting at about 30.4–30.9. The table scored 32.51, then 30.67 in a normal batch. Parallelising the setup on top of it (query parsing and interning on all 12 threads) gave &lt;strong&gt;32.66 / 32.10&lt;/strong&gt;, and that shipped.&lt;/p&gt;

&lt;p&gt;Then came a tiny one. Storing the answer step's scratch result lists as &lt;code&gt;u16&lt;/code&gt; instead of &lt;code&gt;u32&lt;/code&gt; also trimmed scored S from 761 to 758. On the board it scored &lt;strong&gt;33.62 / 33.80&lt;/strong&gt;, with T down to about 120 ms from the ~150 ms I started the day with.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Track C: smaller buffers, lower M
&lt;/h3&gt;

&lt;p&gt;C reads &lt;code&gt;records.csv&lt;/code&gt; through per-thread &lt;code&gt;pread&lt;/code&gt; buffers instead of mapping it. Shrinking the read buffer to 32 KiB and the event blocks to 512 entries brought M to 11.0 MB at the same T (22.9 ms). K went from a best of 39.94 to &lt;strong&gt;41.13 / 41.08&lt;/strong&gt;. Prewarmed input pages can remain charged outside the measured cgroup, but its peak still includes anonymous memory, kernel memory and tmpfs. Cached input is not categorically free.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Line trims with identical machine code
&lt;/h3&gt;

&lt;p&gt;The cheapest wins in the contest were deletions, but I only trusted a deletion if I could prove it changed nothing that runs. For Track A, the agents removed selected &lt;code&gt;#[inline(always)]&lt;/code&gt; attributes, dropped guards that were provably always true, and folded a few statements together. Then they &lt;strong&gt;diffed the disassembly function by function&lt;/strong&gt;. For the attributes we removed, the hot code was instruction-for-instruction identical. Where removing an attribute did change the code, it stayed.&lt;/p&gt;

&lt;p&gt;A's scored S went from 350 to 325. Its board runs averaged 46.96 against production's 45.97–46.90, and the S gain itself is deterministic. B got the same treatment, with scored S falling from 758 to 701: it scored 33.92 and 34.13 and was kept. An earlier D trim reduced S from 407 to 383, but its board K was 23.93 against the previous best of 24.11.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failures, and what they taught me
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;VM wins that lost on the board.&lt;/strong&gt; That opening story was Track A's compact endpoint dictionary using atomic slot publication. On the VM it looked faster. On the board it scored &lt;strong&gt;38.74 and 39.73&lt;/strong&gt;, with T at 32 and 30 ms. The control scored 45.97 at T 22.4 ms. A deferred-formatting change reduced board memory to about 18.1 MB but went the same way (40.79 / 45.78), and B's "24-byte slots, twice the table" faded over three runs (31.16 → 28.95 → 26.87). Early on, an allocator-tuning change sent A's board memory from about 22 MB to 65.6 MB. The VM is a filter, not a judge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PGO variation can hide small wins.&lt;/strong&gt; I compared multiple PGO builds per side before trusting small differences. Single-threaded training does not by itself guarantee identical binaries; that needs checking in the build outputs. (Adding a PGO stage to the Dockerfiles for A, C and D did not improve their logged board K, and those Dockerfile lines count in S.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benchmark order bias.&lt;/strong&gt; One of our scripts biased the run order. For a while, that made a whole batch of comparisons unreliable. Balanced ordering fixed it, and now I don't trust any A/B number unless I know the order was alternated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Board noise comes in batches.&lt;/strong&gt; Running the same code again on the board can move K materially. Some batches are just slow: once, B's T jumped from about 150 to 195 ms with no code change. Worse, the tracks don't slow down together: in one batch B was slow while A ran normally, and in another A lost badly while B and D looked fine. "The other tracks were normal" cannot establish that yours was unaffected. So the rule became: repeat promising candidates, and compare against a control from the &lt;strong&gt;same track&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the leaders did better
&lt;/h2&gt;

&lt;p&gt;After the freeze, the top teams' repositories went public, so I could replace my evening-before guesses with facts. At freeze the leader was ahead of me by 1.31x (A), 1.49x (B), 1.35x (C) and 1.39x (D) on K. Almost all of that was T; on S I was often ahead. And none of the gap was micro-tuning. It was structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Track D (shortest paths):&lt;/strong&gt; they contracted the road graph's chains of degree-2 nodes into shortcut edges, stored adjacency in fixed 4-slot rows with 16-bit labels, and used a bucket queue instead of a heap. I renumbered nodes for locality and tuned a heap Dijkstra. Same problem, different shape.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Track B (text index):&lt;/strong&gt; branch-free tokenizing: an AES-based hash, cache-line buckets holding 7 tags compared at once, and an AVX2 left-pack that routes tokens by class, with the answers built up stage by stage. My loop was fast, but it still branched on every token.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Track A (log ingest):&lt;/strong&gt; they overlapped parse and summary. An hour is finished as soon as the parse is two hours past it, and pages are released in parallel before exit. I ran two clean phases and optimised each one separately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Track C (streaming join):&lt;/strong&gt; owner threads with lock-free message rings, so the hot path has no atomics. I made a shared atomic table faster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other top teams found their own versions of the same moves: scanning the corpus once and answering queries on the fly instead of building postings, perfect hashing so each token is a single probe, and boolean queries compiled into truth tables. Pure-Rust teams were in that group too, so the language wasn't what held me back.&lt;/p&gt;

&lt;h2&gt;
  
  
  What AI did, and what it didn't
&lt;/h2&gt;

&lt;p&gt;I ran this sprint with AI agents doing most of the typing. That was the experiment, and here's the honest result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI raised the floor, and it made experimenting much faster.&lt;/strong&gt; I had correct, byte-identical, reasonably fast versions of all four tracks within hours. Agents profiled on an x86 VM overnight, wrote thousands of experiment files, and kept a steady loop of board trials going: keep the win, revert the loss. They found the in-place counting sort, the hash-and-displace table, and the line trims with identical machine code. On my own I would have reached maybe half of that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It didn't replace understanding the algorithm.&lt;/strong&gt; My agents were excellent hill-climbers: give them a design and they make it faster. Not once did they step back and say "a road graph is mostly chains, so contract it", or "this join wants owner threads, not a shared table". Hill-climbing took me to the top of my hill, and the winners were standing on a different one. Going back over it, the expensive mistake was mine: I let the first working design become the only design.&lt;/p&gt;

&lt;p&gt;If I did it again:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Spend day one on the problem, not the code.&lt;/strong&gt; What does the data look like, what's the lower bound, and what would someone who has read the papers do?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prototype three or four fundamentally different designs early&lt;/strong&gt;, with AI doing the typing, and only then optimise the one that wins.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the structural thinking for myself.&lt;/strong&gt; Use the agents for what they're superb at: fast hands, tireless measurement, and grinding out the last few percent.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI makes a good engineer a lot faster. It doesn't yet turn a hill-climber into an algorithm designer.&lt;/p&gt;

&lt;p&gt;I kept only what survived the scoring machine twice, and every experiment is logged honestly. If you take one thing from this post: &lt;strong&gt;your benchmark is a hypothesis about the scoring machine, not a measurement of it, and your first design is a hypothesis too.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Code and performance logs (including recorded run IDs, T, M, S, K) are in the &lt;a href="https://github.com/Xuefeng-Zhu/speed-demon-2026/tree/speed-demon" rel="noopener noreferrer"&gt;team PeppaPig repository&lt;/a&gt;, one &lt;code&gt;PERF.md&lt;/code&gt; per track.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>performance</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
