aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / evidence / store_512b_qemu_2026-09-25.md
| 1 | # Store v1 over NVMe, 512-byte LBA: QEMU qualification (2026-09-25) |
| 2 | |
| 3 | Lane: `feat/p3-store-512b-crash-qemu` (PR #136), code commit |
| 4 | `51eaa4c80bfa806d737c0068a0ce9b82c1695e0c` (clean tree), base `main` `123929a`. |
| 5 | Test-only. QEMU only. No ADR 0015 format, recovery-policy, NVMe-policy, or |
| 6 | Machine 1 changes. `P3_STORE_QEMU` and `P3_STORE_NATIVE` are not claimed. |
| 7 | |
| 8 | Reproduce: `./scripts/qemu_store_512b_crash_test.sh` |
| 9 | Same commit: `AIENOS_STRICT=1 ./scripts/verify_all.sh` exit 0, 273 PASS, |
| 10 | 0 FAIL, 0 SKIPPED (this script is not yet part of verify_all). |
| 11 | |
| 12 | ## What each tier proves, and what it does not |
| 13 | |
| 14 | | Tier | Marker | Method | Claim | Not claimed | |
| 15 | |---|---|---|---|---| |
| 16 | | Smoke | `STORE_NVME_INTEGRATION_512B_QEMU` | provision, one transaction, reopen through the real NVMe driver at 512-byte LBA | the Store engine runs over 512-byte geometry via `BoundedNvme` | Machine 1 behaviour | |
| 17 | | 1 | `STORE_512B_CRASH_OBSERVED_QEMU` | host `SIGKILL`s QEMU at each of the 7 engine checkpoints, settle 0 and 3, then reopens | after a VM/process crash at any checkpoint the store reopens `Valid` at generation N or N+1 as ADR 0015 orders | power loss: QEMU's accepted writes survive in the host file whether flushed or not; volatile-cache loss is #133's scope | |
| 18 | | 2a | `STORE_512B_ROOT_TEAR_CLOSURE` | host proof over the Tier 1 images killed at `after_first_flush` and `after_final_flush`: the images differ only in one superblock slot, and all 256 sector subsets of that 8-sector write are enumerated | on a 1-LBA-atomic device (AWUPF=0) a torn root write can only leave the old or the new slot, because every non-zero superblock byte lies in sector 0 and the engine only overwrites a zero or valid slot (sectors 1..7 zero in both) | device behaviour below one-LBA atomicity | |
| 19 | | 2b | `STORE_512B_INJECTED_ROOT_RECOVERY_QEMU` | deterministic media-corruption injection into the inactive slot by `aienos-store-tool` (kernel encoder and CRC; CRC recomputed so each case reaches the check it names) | the engine's malformed-peer, graph-bad-newer and unsupported-version decisions hold over the native NVMe path | these are not crashes and not torn writes | |
| 20 | |
| 21 | The peer classification in every line is `Store::peer_condition()`, the |
| 22 | engine's own decision at open, not a re-derivation in the guest. |
| 23 | |
| 24 | ## Results |
| 25 | |
| 26 | ```text |
| 27 | === Integration Smoke (512-byte LBA) === |
| 28 | PASS integration smoke (provision + transact, 512b non-atomic qualification active) |
| 29 | PASS reopen smoke (generation=2 state=Valid peer=Valid) |
| 30 | |
| 31 | === Tier 1: Checkpoint SIGKILL Campaign === |
| 32 | settle=0 cp=before_first_write saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK |
| 33 | settle=0 cp=after_payloads saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK |
| 34 | settle=0 cp=after_catalog saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK |
| 35 | settle=0 cp=after_commit_record saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK |
| 36 | settle=0 cp=after_first_flush saw=1 reopen=1 slot=1 gen=1 state=Valid peer=Zero expect=N -> OK |
| 37 | settle=0 cp=after_superblock_write saw=1 reopen=1 slot=1 gen=2 state=Valid peer=Valid expect=N_NP1 -> OK |
| 38 | settle=0 cp=after_final_flush saw=1 reopen=1 slot=1 gen=2 state=Valid peer=Valid expect=NP1 -> OK |
| 39 | settle=3 cp=before_first_write saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK |
| 40 | settle=3 cp=after_payloads saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK |
| 41 | settle=3 cp=after_catalog saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK |
| 42 | settle=3 cp=after_commit_record saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK |
| 43 | settle=3 cp=after_first_flush saw=1 reopen=1 slot=1 gen=4 state=Valid peer=Valid expect=N -> OK |
| 44 | settle=3 cp=after_superblock_write saw=1 reopen=1 slot=1 gen=5 state=Valid peer=Valid expect=N_NP1 -> OK |
| 45 | settle=3 cp=after_final_flush saw=1 reopen=1 slot=1 gen=5 state=Valid peer=Valid expect=NP1 -> OK |
| 46 | STORE_512B_CRASH_OBSERVED_QEMU: PASS |
| 47 | |
| 48 | === Tier 2a: Root Tear Closure (host proof over Tier 1 images) === |
| 49 | settle=0 STORE_ROOT_TEAR_CLOSURE: PASS (slot=1 old=zero new=gen2 sector_bytes=512 differing_sectors=[0] combinations=256 as_old=128 as_new=128) |
| 50 | settle=3 STORE_ROOT_TEAR_CLOSURE: PASS (slot=0 old=gen3 new=gen5 sector_bytes=512 differing_sectors=[0] combinations=256 as_old=128 as_new=128) |
| 51 | STORE_512B_ROOT_TEAR_CLOSURE: PASS |
| 52 | |
| 53 | === Tier 2b: Injected Root Recovery (media corruption, one defect per case) === |
| 54 | case=bad_crc decode=BadSuperblockCrc gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK |
| 55 | case=wrong_magic decode=BadSuperblockMagic gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK |
| 56 | case=nonzero_reserved decode=NonzeroReserved gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK |
| 57 | case=wrong_slot_id decode=WrongSuperblockSlot gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK |
| 58 | case=region_mismatch decode=Ok gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK |
| 59 | case=seeded_garbage decode=BadSuperblockMagic gen=1 state=DegradedRecovery peer=Malformed readonly=1 expect=degraded:Malformed -> OK |
| 60 | case=unsupported_version decode=UnsupportedVersion gen=none state=none peer=none readonly=0 expect=refuse:UnsupportedVersion -> OK |
| 61 | case=graph_bad_newer decode=Ok gen=1 state=DegradedRecovery peer=GraphBadNewer readonly=1 expect=degraded:GraphBadNewer -> OK |
| 62 | case=control_new_root decode=Ok gen=2 state=Valid peer=Valid readonly=0 expect=valid:gen2 -> OK |
| 63 | STORE_512B_INJECTED_ROOT_RECOVERY_QEMU: PASS |
| 64 | |
| 65 | === Final Summary (commit 51eaa4c80bfa806d737c0068a0ce9b82c1695e0c) === |
| 66 | STORE_NVME_INTEGRATION_512B_QEMU: PASS |
| 67 | STORE_512B_CRASH_OBSERVED_QEMU: PASS |
| 68 | STORE_512B_ROOT_TEAR_CLOSURE: PASS |
| 69 | STORE_512B_INJECTED_ROOT_RECOVERY_QEMU: PASS |
| 70 | STORE_512B_CRASH_RECOVERY_QEMU: PASS |
| 71 | P3_STORE_QEMU: NOT CLAIMED (QEMU campaign; native persistence conditions separate) |
| 72 | P3_STORE_NATIVE: NOT CLAIMED |
| 73 | ``` |
| 74 | |
| 75 | Reading the settle=3 tear-closure line: generation 5 overwrites the |
| 76 | generation-3 superblock in slot 0, so the proof covers overwriting a live |
| 77 | older root, not only a zero slot. |
| 78 | |
| 79 | ## Changes from the first #136 revision |
| 80 | |
| 81 | - Tier 2 renamed from "deterministic torn root recovery" to injected-root |
| 82 | recovery. The old cases pre-filled the slot with `0xAA`, a state the engine |
| 83 | never writes, and applied the magic and reserved defects after the CRC, so |
| 84 | all three only exercised the CRC check. |
| 85 | - Injection base moved from genesis (`before_first_write`) to |
| 86 | `after_first_flush`, with the real generation-2 superblock as the source. |
| 87 | - `os.urandom` garbage replaced by a fixed-seed xorshift64 stream. |
| 88 | - All `python3` removed from the script (`aienos-store-tool`). |
| 89 | - Guest peer telemetry now comes from the engine (`PeerCondition`); the old |
| 90 | guest heuristic labelled any decodable peer `GraphBad` from mount state. |