allod check: instantiate machines two to a process #244
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!244
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/check-machine-sweep"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Owner summary
allod/archetypesabout 2 s faster out of 78 s, which is inside the run-to-run noise. My recommendation is to close this without merging unless that second matters to you.allod checkchanges, and only once a machine is rebuilt with tools that carry it.nixprocess, not one. The transcript shows==> machines <a>, <b> (one nix process)for a pair.allod/archetypesreports the sameAll 31 steps passed (checks: 18 built)before and after.Refs allod/archetypes#118. That issue was written against
check.sh, which allod/archetypes#117 deleted, so the change is here.What was measured
All on one 8 GiB dev VM, 6 cores, Nix 2.34.8, which other agents were using at the same time. Before is
allodbuilt from2caeb5e, after is this branch. The two were run alternately, five rounds; round 1 is left out of the means because another build was running during it.allod/archetypes, 4 machines and 18 checks, wall clock, rounds 2 to 5The 8-machine figure is an upper bound, not a forecast. That flake is the four template machines plus a second evaluation of each made with
extendModules, and name order pairs every machine with its own twin, which shares more with it than two unrelated machines do.What the issue claimed, and what was found
nix build --dry-runon an unchanged tree, 1.2 s, answered from Nix's evaluation cache. The first run on a tree took 27 to 31 s for four machines.allod checkdoes not use that cache: every step isnix eval --apply--keep-goingkeeps per-machine failure reportingallod checkonallod/archetypesthey are 23 s of 78 s. The checks are 54 sWhat changed
cmd/allod/check.go,cmd/allod/check_nix.go: machines are grouped in twos; a pair is one step kind that carries its two machine steps to fall back on.cmd/allod/check_test.go: the pair's argv is pinned, and two tests cover grouping with an odd machine out and the fallback after a failed pair.tests/allod-check-selftest.sh: asweptfixture of three green machines, two assertions on theredfixture that the pair was tried and then run alone, and a differential fixture whose second machine is not a derivation.docs/allod-check.md,README.md: the behaviour, and the memory table behind the choice of two.Risk
R2. The worst credible failure is the gate passing a machine that is broken. A pair uses the same expression as a single machine step and passes only when
nixexits 0 having forced both derivation paths; any failure sends both machines through the unchanged single-machine step. Rollback is a revert.Not covered: machine pairs larger than the template's. Peak memory for a pair is roughly the two machines added together, so a fork with much larger machines will see a higher peak than the 1.4 to 1.7 GiB measured here.
Validation
Run by me on the tree committed as
9036a89:go test ./cmd/allod/ -run 'Check|NixString'allod checkin this repository, which buildsgo-checksand the other eight checksAll 11 steps passed (checks: 9 built)ALLOD_UNDER_TEST=<this build> bash tests/allod-check-selftest.shnix flake checkallod checkonallod/archetypesat9577fb5All 31 steps passed (checks: 18 built), same as beforeNot run: the gate against a real deployment with eight machines. None is reachable from this VM.
Review
One cold pass by
gpt-5.6-terraon the diff, one fix round.If a faster gate is the goal
Two things would deliver one, and neither is in this PR because each is a decision about what the gate is allowed to do:
Closing without merging, at the owner's request: about 2 s off a 78 s gate, inside the run-to-run noise, is not worth the added code. The measurements in the description stand as the record for allod/archetypes#118.
Pull request closed