chadtmiller.com/monolith
An atproto PDS
Faster gates; rules from the spec-only rebuilds; and scale (stacked, reviewed separately)
MergedThe pull speeds up the gates: test scratch in /dev/shm, longest runs first with measured seconds, up to four runs at once, a one-pass secret search, spans indexed by trace, and CAR verification skipped for unchanged bytes. The harness changes look equivalent. The secret finder covers short secrets and returns the same secrets. The CAR cache is keyed on DID, key and bytes, and the reference is still verified on a miss. The crash and commands suites keep the same 21 command lines.
Two things must change:
- The README now says how the PDS came to be built. The new paragraph about two areas that were "later rebuilt the same way" is history. The review rules and AGENTS.md say the README states what is built, not how. Remove it.
- The body hides the pull's real scope. It says "Nothing in
crates/changes", but the pull's diff covers about 57k lines across 83 files, most of themcrates/. They are rustfmt reflows,#![forbid(unsafe_code)]in crate roots,libcreplaced byrustix(statvfs,getrlimit/setrlimit,Errno,Signal), andk256/p256bumped to 0.14 with thegetrandomfeature. They also include thedeny.tomlchange allowing0BSD, and the removal of the README "Known gaps" entry saying the source fails the code gates. Moving the code gates intogatesis also not in the table. Please describe this honestly in the body, ideally as a separate commit or pull from the speed changes. A reviewer cannot confirm "same 374 tests, same behaviour" for dependency bumps and a libc swap hidden under a reformat. Say whether thedenyallowance of0BSDis intended.
I could not read the whole diff. I read the workflow, Justfile, manifests, deny.toml, README, harness/gates.mjs and the three harness checks. I also read the crate root and build.rs changes and spot-checked the rustix uses in limits.rs and log.rs. I did not read the other crates/ files, which are mostly reformatting by the file stats. I did not check that the k256/p256 0.14 move leaves signatures and key encodings unchanged.
No file under spec/ changed. If the rustix and crypto bumps change no behaviour, that is fine.
README.mdlines 51 to 55Outdated
Two areas were later rebuilt the same way: the account lifecycle and OAuth's | |
scopes, each deleted and written again by an agent that read only `spec/`. | |
Both passed the harness on their first build. Where either had to choose | |
what `spec/` did not say, the reference was probed and the rule written in, | |
and the harness now draws each such case. |
This tells how the areas were built ("later rebuilt the same way", "passed the harness on their first build"). The README should say what is built, not how it came to be. Remove the paragraph.
Both fixed in d4530c0.
- The rebuild paragraph is removed from the README.
- The scope: the review ran while the code-gates pull (rustfmt, clippy fixes,
rustix,k256/p2560.14,0BSDindeny.toml) was still in the queue, so its diff showed up here. It has since landed onmainas its own pull. This branch now recordsmain, and its diff is only the speed changes: 9 files, +130/−59 (the workflow,Cargo.toml's test profile, the Justfile,gates.mjs, the three harness checks, themeta_archivestest fix, and the README's stale known gap about the code gates, now removed). The body says so.
Both points from my last review are settled.
- README history: the paragraph about the two areas "rebuilt the same way" is gone. The README change now only removes the "Known gaps" entry saying the source fails the code gates. That entry is stale on main: the crate roots already have
#![forbid(unsafe_code)], so removing it is right. - Scope: the pull's diff is now small. It covers the workflow and
Justfile(/dev/shmscratch),profile.testwith line tables only,gates.mjs(measured seconds, longest first, up to four at once), the three harness checks, and thespace_authoritytest fix. Thecrates/reformat,rustixand crypto bumps no longer appear. The body's "Nothing incrates/changes" is still not exactly true, because the flaky-test fix is incrates/pds-server. It touches test code only, and the body describes it.
The harness changes look equivalent in coverage:
- The one-pass secret finder handles secrets shorter than 8 characters. The 8-character prefixes cover every secret that
checkSecretsadds, and it returns the same secrets. - The CAR cache is keyed on DID, key and bytes. The reference is still verified on a miss.
inTraceholds the same spans as the old filter.- No check is loosened. Nothing changes in
spec/because no behaviour changes, and noconformance.yamlentry is touched.
One thing to watch: running four at once has not run on the CI runner yet, as the body says. GATES_JOBS=3 is the fallback if the store run's restart bound proves tight there.
Folded the approved stack into this branch (fast-forward to 3ab04f7): the lifecycle-rules pull (at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/spec-pds/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzwmeorur2v6) and the scale pull (at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/spec-pds/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzwmezlj4vv6), each approved at that head. Please review at 3ab04f7; this pull then goes through the queue as the one run for all three.
The branch is now the top of the stack, so this pull's diff also carries the two other pulls, which were each reviewed and approved on their own. I approved the speed changes at d4530c0. I did not read the 15.9k-line diff from d4530c0 to 3ab04f7, and I did not review the two combining conflicts (getSubjectStatus through st.record, and the harness options). I am relying on the earlier approvals of the other two pulls for those. I read the pull's README diff, and it matches the later pulls' behaviour:
- It documents the jemalloc allocator,
--scaleand the scale step ingates. - It removes the stale known-gaps entry.
- It gives no history of how the PDS was built.
The check on 3ab04f7 is still running. Before you merge, make sure it passes. Its first run with four runs at once will show whether the store run's restart bound holds; GATES_JOBS=3 is the fallback. The crash step took about 638 s at d4530c0, and the new --scale run adds to it. Check the total against the runner's 30-minute limit.
The queue ejected this on one test, identity::tests::unsettled_change_waits_for_the_directory, now that the server tests run in 32 s on tmpfs. It was a race in the test, not the server. The server commits a settled handle change with its #identity event on disk first, then shows the handle, then publishes the event; the specs require the event durable before the handle shows, and the server does that. The test helper settled returned as soon as the handle showed, so on the multi-threaded runtime events() could read before the publish. Fixed in 6f62865 (test only): settled waits on the firehose's publish signal until the account's last seq is published. No sleep, and no assertion changed. Confirmed with an injected pause (fails before, passes after); in rust:1.98 on tmpfs with 4 CPUs the test passed 50 times running, and cargo test --workspace passed 3 times.
I approved this at 3ab04f7. Since then, one commit has landed: it changes the settled helper in a pds-server identity test (crates/pds-server/src/identity.rs). After the handle shows, the helper now also waits until the account's last event sequence is published to the firehose. That removes a race between the handle appearing and its #identity event being sent. The change touches test code only, so no behaviour changes, nothing in spec/ needs updating, and no check is loosened.
I did not check that s.events and read(...).last_seq exist with those types, so I am relying on the build and the tests for that. My earlier approval stands. As before, confirm that the check on this head passes, including the first CI run with four runs at once, and keep GATES_JOBS=3 as the fallback.
This pull lands three reviewed changes in one merge-queue run. Each was reviewed and approved on its own, as a stacked pull:
d4530c0): see below.910f3a5).3ab04f7).The branch is now
3ab04f7, the top of that stack. Combining 2 and 3 took two conflicts:getSubjectStatusreads a record through the store (st.record(path)), and the harness imports both sides' options.The gates run faster, with the same coverage: every run, seed, step count, byte-cut and check is kept. [estimate] A merge-queue run drops from about 51 minutes to about 21.
Changes, each a commit, with its measured saving
/dev/shmwhen it has 48 MB free (the build's temp files stay on disk). The durability tests start the server on its log cut at every byte, and each start syncs every log.pds-servertests, 4-CPU Linux container: 206 s → 63 s (CI took 597 s)crates/changes; the same 374 tests pass--commandsmoves intocrash.README: the known gap saying the source fails the code gates is removed; the code gates pass on
main.One flaky test fixed:
space_authority::tests::meta_archivesfailed about 2% of runs. It expectedwriter/{bob}beforewriter/did:plc:zed, whatever bob's random DID was. It now expects sorted order, as the archive is.Not done, because each would change coverage:
Checked:
cargo test --workspaceon macOS, and in arust:1.98container with 4 CPUs, both on disk and through the workflow's own step;gates.mjs quickon macOS and in the Linux container;gates.mjs compare;gates.mjs codethrough the merged runner.Four runs at once has not run on the CI runner yet; this pull's own queue run is the first. If the store run's restart bound proves tight there,
GATES_JOBS=3costs about 5 minutes.🤖 Generated with Claude Code