T27.AI

Blog

From a minute to a second: where the time to build t27 went, and where it still goes

2026-10-11 · 11 min read

[measured on one 8-core Mac whose load varied overnight; pairs taken under the same load] One overnight loop measured every place t27 builds and waits, and fixed what the numbers pointed at. A warm t27c frontier went from 55-68 s to about 0.9 s, an unchanged bitstream is found in 0.22-0.39 s instead of 4.3-8.9 s, a board run after approval no longer builds first, and the corpus suite CI runs on every pull request dropped from 221-257 s to 108-140 s. Almost all of the old time went into recomputing what had not changed and into running independent work one item at a time. What is left: about 2 s per spec in zig's relink, 27 s of nextpnr per logic change, about 14 s to load a board, and a 72 s C-header gate. Each speed-up is now one `tri hot` command, recorded before and after, and set against eight build tools in a TOP.

Title card, no illustration yet, for: From a minute to a second: where the time to build t27 went, and where it still goes
View the title card at full size
#t27#Measurement#FPGA#Verification

Overnight from 10 to 11 October, one loop went through every place t27 builds something and makes its author wait, measured each one, and changed what the measurements pointed at. A warm t27c frontier went from about a minute to under a second, a bitstream that has not changed is found in a quarter of a second instead of four to nine, and the corpus suite that CI runs on every pull request takes half its old time. Thirteen pull requests, all merged; the record is the loop ledger, t27#8737.

Seconds spent waiting, before and after (log scale)beforeafter0.1 s1 s10 s100 s1000 sfrontier, warm551frontier after a t27c rebuild556.3watch: save to a hub spec (16 reruns)34.513.9silicon: unchanged design4.30.39t27c suite (local)394185CI: corpus ratchet step221140
Seconds before and after for six paths, on a log scale. Each pair is the conservative end of its measured range: the slowest "after" against the fastest "before". Measured on one 8-core Mac whose load varied from about 3 to about 140 overnight.

Where the time went

Almost none of it went into work that was new. It went into recomputing what had not changed since the last run, and into doing independent pieces of work one after another. Every fix below is one of those two.

WhereBeforeNowWhat changedPR
t27c frontier, warm55-68 s~0.9 sThe four generated-code hashes of a spec come from a cache keyed on the spec, every spec it imports, and the bytes of the t27c binaryt27#8741
t27c frontier after a rebuild of t27c55-68 s6.3 sThe cache is filled by 8 workers first; the decisions are then made in order, exactly as beforet27#8847
frontier --watch, idle33% of a core3%Each look stats the files and reads nothing unless a stat movedt27#8825
frontier --watch, a save to a spec 16 others import34.5 s13.9 sThe reruns go side by side; specs that share a file name stay on one workert27#8856
t27c silicon, design unchanged4.3-8.9 s0.22-0.39 sTool digests (the 333 MB chipdb among them) come from a cache keyed on the file stat; the Python packages are read from the venv instead of pip freezet27#8808, t27#8814
A board run after /bench approvebuild first, 30-550 sload onlyThe bench agent builds the bitstream while the job waits for approval, without touching the cablet27#8797
t27c suite --corpus-only394-498 s167-185 sAbout 13,000 per-spec runs go 8 at a time; results are folded in file ordert27#8837, t27#8840, t27#8845
The same suite step in CI221-257 s108-140 sSame change, measured on the runnerst27#8837

Three rules did most of the work

  1. Key a cache on everything that can change the output, and on nothing else. The generated code of a spec depends on its imports, because constants are inlined across them, so the key holds the whole import closure. It also holds the binary itself: any rebuild of t27c is a new generator. A key that names too little serves wrong answers; a key that names too much, like a commit of an unrelated checkout, throws good answers away.
  2. Check something cheap before something expensive. A file stat costs microseconds; reading and hashing 333 MB costs seconds. The watch and the digest cache both look at the stat first and read only what moved, and they take the stat before reading, so an edit that lands during a read is seen next time.
  3. Run independent work side by side, and prove it changed nothing. Every parallel phase folds its results in input order, and each one was run both ways, with T27_SUITE_JOBS=1 and with the default: the error output was byte-identical, the JSON summaries equal apart from their timing fields, 259 failures both times.

Defects found on the way

Where the time still goes

PathNowWhere it goesNext step
Edit a spec, get its verdict~2 s per specZig compiles and relinks the test binary on every run; t27c itself takes 0.03 sSkip the relink: about 0.2-0.3 s per spec. It changes the test runner that every seal names, so it needs one full re-mint
Change logic, get a bitstream36.7 s (ternary_link)nextpnr 27.3 s: clock routing searches the whole chip for the BSCAN to BUFG arc, and the router sets up every wire of the 200T before routing a few thousandA patch with byte-identical output makes clock routing 1.8-5x faster (t27#8754); a place-and-route process that stays resident would remove the setup
Bitstream onto the board~13-15 s9.73 MB over JTAG at the default clockA faster JTAG clock on the HS2 cable, about 3 s; needs a test on the board
Approval to the start of a runup to 60 sThe bench agent polls once a minutePoll every 15 s, at about 180 more GitHub API calls an hour
t27c suite~170 sThe C-header gate: 72 s of cc -fsyntax-only on every spec, every runCache its results by content (t27#8900)

Each next step in this table changes something outside the loop: what every seal records, what the board is sent, the GitHub API budget, or a file the project only lets its owner open for hand-written code. None of them was taken without the owner.

Every speed-up as one command, before and after

Each speed-up above is now one tri hot word (t27#8953): watch, frontier, prebuild, suite and caches, with tri hot alone as the check. Below, each one was recorded twice on this Mac on 11 October: before, with the speed-up switched off by the same knob used to verify it, and after. The typing is staged; every byte printed is real and arrives when it was printed. time prints the real duration.

Before: an empty cache and T27_SUITE_JOBS=1, every spec generated again one after another, as every walk ran before t27#8741: 17.9 s. After: the cache warm, 1.4 s. Both print the same decision line, 1284 of 1856 reused.

tri hot frontier, warm

The after run in full; its before run is at t27.ai/term/hot-frontier-before/. Open the recording on its own page.
Before: T27_SILICON_REBUILD=1 forces yosys, nextpnr and the bitstream for ternary_link, what an approved board run waited for before t27#8797: 32.4 s. After: the bitstream from the reuse cache, 0.5 s, the cable never touched. The reuse key and the audit of every tenth hit make the cached bitstream the same bytes a build would write.

tri hot prebuild, a reuse hit

The after run in full; its before run is at t27.ai/term/hot-prebuild-before/. Open the recording on its own page.
A save to reuse.t27 reruns 16 specs. Before, one at a time: the first verdict 3.1 s after the save, all 16 after 42.3 s. After, side by side: the first after 8.2 s, all 16 after 21.5 s. The batch finishes twice as fast; the first answer comes later, because eight compiles share the processor. Each verdict prints the moment its rerun ends (t27#8958).

tri hot watch, a save to reuse.t27

The after run in full; its before run is at t27.ai/term/hot-watch-before/. Open the recording on its own page.
Before: T27_SUITE_JOBS=1, about 13,000 per-spec runs one after another: 478 s. After: 8 workers, 231.5 s, the same 259 failures. Both on a loaded machine, played at x40. The FAIL lines the suite prints to stderr scroll past in both panes.

tri hot suite, 8 workers

The after run in full; its before run is at t27.ai/term/hot-suite-before/. Open the recording on its own page.

tri hot: the hot paths against their budgets

tri hot runs each hot path once to warm it, then once timed, and says OVER when one is past its budget, or ran and failed. It is the regression test for the caches above, and the loop now starts every tick with it. Open the recording on its own page.

tri hot caches: every cache against its eviction limit

The gen-hash, bitstream and digest caches, each with its size and the limit t27c enforces (t27#8930, t27#8935). Open the recording on its own page.

Against the field: the TOP

Six things this post needs, a spec’s verdict and then its bitstream on a board, checked against each tool’s own documentation. Yes means the tool does it; half means partly, or only with a separate tool or by wrapping the flow; no means it does not, or the documentation checked does not say so.

t27 tri hotBazelNxGradleNixccacheVivado incrementalQuartus Rapid RecompileLiteX
Reuses a passing verdict when nothing it depends on changedyesyesyesyes½nononono
Reruns only what a save affectsyes½ (ibazel)yesyesnonononono
Skips FPGA place-and-route when the design is unchangedyes½nono½no½½½
Checks its own cache hits by rebuilding and comparingyesnononoyesnononono
Bounded cache with automatic evictionyes½nononoyesnonono
Cache shared across machinesnoyesyesyesyesnononono
Score53.53331½½½
  1. t27 tri hot, 5 of 6. What it lacks is a shared cache: every machine builds its own, and the shared-bitstream path (P8) is a spec, not a service.
  2. Bazel, 3.5: cached test results and a remote cache; a watch only through ibazel, and disk-cache garbage collection still experimental.
  3. Nx, Gradle and Nix, 3 each. Nx and Gradle cache tasks and rerun on change; Nix shares binary caches and can rebuild a path to check that it is deterministic.
  4. ccache, 1: a bounded compiler cache, and nothing above the compiler.
  5. Vivado incremental, Quartus Rapid Recompile and LiteX, half each. Vivado reuses placement and routing from a reference checkpoint but still runs them; Quartus reuses fitting for a change it judges small, and the Pro edition removed it in 21.1; LiteX reloads firmware without rebuilding the gateware. None skips a build whose inputs did not change.

This TOP is weighted toward this workflow: its rows are the six things t27 needed. On remote execution, ecosystem and scale, which is what a general build system is chosen for, Bazel, Nx, Gradle and Nix are far ahead, and t27 has no shared cache at all. No competitor was run on this workload; every number in this post is t27’s own, measured on one Mac.

What this does not settle

Receipts

Work with me

Want this kind of check on your own design?

I audit RTL and build independent, bit-exact models, then take the result through synthesis and, when useful, onto an Artix-7 board. The first conformance module is free.