feat(kernel): Artemis grows to fill the stick at its first boot -- metadata only, capped at 256 GiB (#92, Task 2)
Build / Image RASPI (push) Successful in 3m30s
Build / Image PC (push) Successful in 3m51s
Build / Image MILKV (push) Successful in 3m47s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 11m40s

Task 2 of plan 2026-10-29-stick-5, accepted in full:
- amd64, aarch64, riscv64: PARITY:V4_POST tests=538 pass=538 fail=0,
  POST: PASSED, [zuse@Hera] ok>; dict_hash 0xfec8c47cfc6f437f on the three
- the PC stick loaded high: 538/538, POST: PASSED, the prompt
- make -C v4 test-32: 39 programs, 0 failures

The acceptance boots' logs, the accept-*.txt verdicts and test-32's output
(logs/20261108-123847/verdicts/). The plan's Task 2 steps ticked; FABRIC-3
XLVIII.9, with one item for a ruling: blk_flush rewrites the whole BAM, now
sized for 256 GiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
This commit is contained in:
Claude
2026-11-08 12:45:33 +00:00
parent a5c1136692
commit f81b5d0563
15 changed files with 814 additions and 5 deletions
+32
View File
@@ -6334,3 +6334,35 @@ Plan `docs/v4.0.0/plans/2026-10-29-stick-5-proxy-zuse-and-real-zuse.md`, Task 1;
test-32`): `PARITY:V4_POST tests=538 pass=538 fail=0` and `POST: PASSED` on all three and the
stick loaded high; `dict_hash 0xfec8c47cfc6f437f` on the three, unchanged (Task 1 adds no word);
test-32: 39 programs, 0 failures.
### 9. #92, Task 2: Artemis grows to fill the stick (2026-11-08)
Plan `2026-10-29-stick-5`, Task 2; `STICK.md` 5a (its 2 TiB cap amended to 256 GiB, R1).
- **Built:** a GPT writer (`gpt_grow_last`, `kernel/src/gpt.c`): the backup entry array and header
moved to the disk's end, the last partition grown to the last usable sector (whole MiB, capped),
both headers' CRCs, the backup written before the primary, the protective MBR's size. The volume
grown to its partition (`kernel/src/v4/sk_v4_grow.c`): its fence -- the Artemis signature and
Zuse's genesis marker -- moved to the new top, the header written last. Metadata only. The image
builder formats the stick's and the data stick's Artemis with a BAM sized for 256 GiB
(`mkartemis --bam-for`, 6144 devblocks), so the grown blocks are tracked already.
- **Found while building, and followed:** the block subsystem places a volume's fence by its
device's size, not by its header (`blk_format_or_load_disk`), so a volume must always fill its
partition. The partition is therefore grown no further than the volume's BAM tracks, and the
volume grown before Artemis's signature is checked or the disk attached.
- **Tested first, seen to fail:** `stick_grow` (a 16 GiB copy) -- no growth, 1137649 user blocks,
`sfdisk`: the backup GPT not at the end; `stick_small` (4 GiB) -- no line; `check_images.sh` --
the two BAM checks. After: `stick_grow` grows Artemis to 12129370 user blocks and reaches the
prompt 8 s after POST; the second boot of the same copy is not grown again and recognises Zuse;
`sfdisk --verify`: no errors. `stick_small`: "under 8 GB -- not grown". Regressions pass:
`genesis` (three ISAs), `stick_genesis`, `stick_boot`, `stick_zuse`, `two_sticks`,
`artemis_unsigned`, `midpull`.
- **Accepted:** 538/538 and `POST: PASSED` on the three and the stick loaded high; `dict_hash
0xfec8c47cfc6f437f` on the three; test-32: 39 programs, 0 failures.
- **For a ruling (not changed):** `blk_flush` rewrites the whole on-disk BAM -- it reads and writes
every BAM page (`bam_flush_to_disk`) on each flush of a dirty block -- and attach reads the whole
BAM. With the BAM sized for 256 GiB, that is 24 MiB each way per flush, where the 2 GiB Artemis's
own BAM was about 140 KiB. Nothing in acceptance flushes a disk block, so it does not show there.
Recommended: flush and read only the BAM pages that hold a volume's user blocks (the same bytes
on disk, v3's behaviour unchanged); it is shared v3 code, so it waits for Captain Bob.
@@ -195,7 +195,7 @@ xHCI USB sticks, `scripts/qemu_session.py`.
GPT, open Artemis, `sk_v4_grow_artemis`, then on as Task 1. Under 8 GB → the "not grown" line,
once. Past the cap → the "left unused" line.
- [ ] **Step 1: Failing tests:**
- [x] **Step 1: Failing tests:**
- **`stick_grow`** (amd64, `--target qemu-stick --stick-gib 16`): first boot: `grown to fill the
stick`, Artemis's `blk: disk` line over 12000000 user blocks (`KERNEL_ARGS=--log-level=info`),
the genesis line, the prompt; the first boot's time printed by the harness (POST to prompt).
@@ -205,11 +205,11 @@ xHCI USB sticks, `scripts/qemu_session.py`.
prompt. Today: FAIL (no line).
- **`check_images.sh`:** the PC stick's and data stick's Artemis BAM is the cap's size
(`mkartemis --check` reports it). Today: FAIL.
- [ ] **Step 2:** Run each: FAIL as listed.
- [ ] **Step 3:** Implement.
- [ ] **Step 4:** They pass; regression: `genesis`, `stick_genesis`, `stick_zuse`, `two_sticks`,
- [x] **Step 2:** Run each: FAIL as listed.
- [x] **Step 3:** Implement.
- [x] **Step 4:** They pass; regression: `genesis`, `stick_genesis`, `stick_zuse`, `two_sticks`,
`artemis_unsigned`, `midpull` (replug: not grown again).
- [ ] **Step 5:** Suite; full acceptance; commit `feat(kernel): Artemis grows to fill the stick at
- [x] **Step 5:** Suite; full acceptance; commit `feat(kernel): Artemis grows to fill the stick at
its first boot -- metadata only, capped at 256 GiB` with the logs and the first-boot time.
### Task 3: acceptance on a fresh data stick