How we actually use AI

We use AI in our work. Below is how, with one full example from start to finish.

AI-assisted vs AI-generated code

For us the difference comes down to whether the engineer understands the code. Who typed it, or how much a model wrote, matters less.

AI-assisted code is code the engineer understands. A model may have written some or all of it, but when someone asks why it does what it does, the engineer can open it, work through it, and give the real answer themselves.

AI-generated code is code the engineer does not understand. It may compile, pass its tests and win its benchmarks, but whatever understanding produced it lives in the model, and the engineer shipping it doesn't have it.

We aim for the first one, and every claim gets measured either way.

We make the design decisions and run the experiments ourselves. The assistant mostly speeds up the boring parts, like harness code, and it's good at poking holes in our reasoning. Whatever it suggests still gets checked against the measurements before we believe it.

If AI assistance makes you trust the work less, everything below is public and you can rerun it yourself. If you find a problem, we'll fix it and credit you.

Who does what

The human

  • Has the idea and the hypothesis.
  • Decides what gets tested, and what counts as a fair test.
  • Builds and runs every benchmark, on real hardware.
  • Rejects bad suggestions and steers every round.
  • Writes and owns the final code that ships.

The assistant

  • Writes harness code and benchmark variants on request.
  • Reads results and states what they do and do not show.
  • Flags suspicious numbers, including its own.
  • Proposes the next experiment.
  • Never runs the benchmarks or publishes a claim.

A worked example: small memcpy

This is a real session, condensed. It produced the small-memcpy paper and the copy routine now in Jsonifier. It started with one sentence: what if a runtime-sized memcpy were split into fixed, power-of-2-sized copies?

  1. HumanThe hypothesis, and narrowing itTest only the hard cases, sizes just above a power of 2 (3, 5, 9, 17, 33, 65, 129), against std::memcpy.
  2. AssistantFirst result, with a warning attachedDecomposition beat the library by 55 to 80%, but the assistant flagged that every test used one fixed size, so the compiler could have hoisted the branches away, so the result didn't prove much yet.
  3. HumanMake it harderSizes must be known only at runtime. Then mixed sizes. Then random sizes.
  4. AssistantCatching a too-good numberA random test showed a 2.5x win. The assistant flagged the repeating sequence: all 4096 entries looped, and a modern branch predictor can memorize that. With a 65,536-entry non-repeating sequence the win fell to 16%. We published the 16%.
  5. AssistantIts own mistake, caught by the compilerThe assistant claimed a fix for tests vanishing from the output. It did not compile, because it touched a protected member. It reported that and reverted the change.
  6. HumanRejecting a bad controlThe assistant proposed a non-inlined variant to isolate call overhead. Rejected: the routine is designed to inline, so measuring it any other way answers the wrong question. Later, only runtime-known sizes stay in the harness at all.
  7. AssistantA harness auditAsked to check for common microbenchmark traps, it found real ones: every copy was 256-byte aligned and src and dst shared offsets. Jitter was added and the numbers were re-run.
  8. HumanUniform random lengths, 1-3 up to 1-55This exposed the design: it lost by up to 56% once lengths spread out. A linear compare chain was mispredicting. A std::bit_width switch fixed it, then a wider overlap window fixed the next cliff at 33 bytes. That switch later cost us too: GCC compiled it to a jump table that lost to glibc on a few ranges.
  9. HumanMeasure the real workloadInstrument Jsonifier and record every copy length across the test corpus. 1.38 million calls, mean 15.6 bytes, 43% exactly 16 bytes. Most of the tuning above 32 bytes turned out to matter for under 1% of calls.
  10. HumanThe final designA compile-time compare tree picks a power-of-2 size class, then copies an overlapping head and tail in chunks matched to the CPU's vector register width, handing anything 256 bytes or larger to the system memcpy. macOS builds keep the std::bit_width switch. Benchmarked against the corpus distribution in random order across five platforms.

Where it landed

The full benchmark results, across every platform and length range, live on the paper itself: see the small-memcpy results.

Inside Jsonifier, the new memcpy was worth roughly 4 to 10 more wins across the 209-test corpus in Json-Performance, on the branch that pits Jsonifier against simdjson (reflection), simdjson On Demand and Glaze.

Earlier designs lost to glibc on some ranges, and the paper reports those losses.

How we keep results trustworthy

A small confession about this website

Everything above is about our research. This website is a different story. Yes, Claude generated most of it. The HTML, the CSS, a fair amount of the prose you are reading right now. We had libraries to optimize and benchmarks to run, and nobody here was going to hand-tune a navbar when there were memcpy cliffs to chase.

So if a page looks suspiciously tidy, or a sentence sounds a little too pleased with itself, now you know who to blame. The benchmark numbers came from us, though, and the CSS mostly didn't.

Poke holes in it

We would much rather hear about a flaw from you than ship it. If you find a benchmark that does not reproduce, a harness that flatters us, or a claim the data does not support, open an issue on GitHub or tell us on Discord. If you are right, we will fix it publicly and credit you by name.