Skip to content

Walk the first real experiment through the whole lifecycle - #121

Merged
iderex merged 3 commits into
mainfrom
experiments/reading-a-tree-of-records
Aug 11, 2026
Merged

Walk the first real experiment through the whole lifecycle#121
iderex merged 3 commits into
mainfrom
experiments/reading-a-tree-of-records

Conversation

@iderex

@iderex iderex commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Closes #40

What this changes

The first experiment, walked through the whole lifecycle in the order the
lifecycle asks for. Three commits: the question, then the code, then the answer.

experiments/reading-a-tree-of-records/ asks whether opening every record on a
tree of a thousand costs more than asking the filesystem about them without
opening them. The answer is yes, by about three times on the machine it ran on,
and the record carries the numbers, the command that produced them, the platform
and what the measurement does not say.

The question was chosen because its answer was genuinely unknown rather than
because it suited the tooling. A directory walk that opens each directory in
turn is not obviously cheaper than reading a kilobyte out of a file the walk has
already found, and on a filesystem with a slower directory layer it may not be.

What failure it prevents

Machinery that has never carried a real load is a design. Everything in the plan
up to here is built for experiments that do not exist, and the cheapest place to
find out that the record format is annoying or that a check fires on legitimate
work is the first experiment rather than the tenth.

What was run

At the commit being pushed, e433a3853fe4b6e78fa79b60e9ba33fda1e26eb0.

go build ./...
go vet ./...
gofmt -l .
(no output)
go test -count=1 ./...
ok  	github.com/Flowfin/lab/cmd/lab	5.400s
ok  	github.com/Flowfin/lab/cmd/pullrequest	1.314s
?   	github.com/Flowfin/lab/experiments/reading-a-tree-of-records	[no test files]
ok  	github.com/Flowfin/lab/internal/check	1.270s
ok  	github.com/Flowfin/lab/internal/hardware	1.143s
ok  	github.com/Flowfin/lab/internal/invariants	1.755s
ok  	github.com/Flowfin/lab/internal/prose	1.381s
ok  	github.com/Flowfin/lab/internal/pullrequest	1.989s

go run ./cmd/lab check .
16 decision records read
the time this run read is 2026-08-11T18:35:27Z
0 refused

go run ./cmd/lab list .
examined .
1 experiment
the time this run read is 2026-08-11T18:35:30Z
  slug                       state     question written  waiting  needs
  reading-a-tree-of-records  answered  2026-08-11        -        none

go run ./experiments/reading-a-tree-of-records
windows/amd64, go1.26.5
1000 experiments, 1108000 bytes of records, 7 rounds
walking the directories:        16.6888ms
walking and reading every file: 50.5875ms
reading costs 3.03 times the walk

The record was accepted from the first commit, in state asking with an empty
answer section, and the listing showed it waiting nought days before the code
existed. That ordering is the thing this board is built on and it is worth
saying that nothing got in the way of it.

What this does not do

The measurement is about one machine, one filesystem and one platform. A tree of
a thousand records is fifty times the size of this repository's own tree today,
so the whole thing is milliseconds either way and none of it is a reason to
change anything. What it settles is which of the two numbers is worth watching
if a walk ever does get slow.

The prototype is not run by any check and nothing in the runner imports it. It
is compiled by go build ./... and read by go vet ./... like everything else
in the module, which is one of the things the walk found and which has its own
issue rather than a repair here.

What the walk cost as an experience, and the follow-up issues it produced, are
written into #40 rather than into the record. The record is about the question
it asked.

No second reader tonight. The transcript above is in place of one, and every
number in it carries the command that produced it.

iderex added 3 commits August 11, 2026 20:33
The plan reaches a first release built on machinery no experiment has ever
used. Machinery that has never carried a real load is a design, and the
cheapest place to find out that the record format is annoying or that a check
fires on legitimate work is the first experiment rather than the tenth.

This is the question, committed before any of its code exists, which is the
ordering this board is built on. The answer is genuinely unknown: the runner
opens every record it finds, and whether that or the walk itself is where the
time goes decides whether the size bound on a record is the interesting number
or the directory count is.

Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
The prototype for the question this experiment asks. It writes a thousand
records into a temporary directory, times a pass that asks the filesystem
about each one against a pass that opens each one, and removes the tree.

It is not run by any check and nothing in the runner imports it, which is
record 0009 and record 0002 respectively. The comparison is between asking and
reading rather than between walking and doing nothing, because asking is what
the runner does before it decides whether a record is inside the size bound,
and a pass that did nothing would measure the loop.

Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
Yes, and by about three times on the machine it ran on. The numbers, the
command that produced them and the platform are in the record, together with
what the measurement does not say: one machine, one filesystem, and a tree
fifty times the size of this repository's own, so the whole thing is
milliseconds either way.

The state moves to answered and the answer date is added, which is the second
half of the lifecycle this experiment exists to walk. What the walk cost as an
experience goes in #40 rather than in the record, because the record is about
the question it asked.

Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
@iderex iderex added this to the 7. The way out milestone Aug 11, 2026
@iderex iderex self-assigned this Aug 11, 2026
@iderex
iderex merged commit bbfab50 into main Aug 11, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Walk the first real experiment through the whole lifecycle

1 participant