# Deliberation record: QEMU re-proof of the allocator-integrated tree (2026-10-15)

Builder crew (micro-agent circle). The session-7 integration wired
kido-alloc into kido-sched, but its ARM64 cross-compile + QEMU proof
never ran — the cross toolchain was lost to a VM replacement mid-
session. The toolchain is back (aarch64-linux-gnu-gcc 13.3.0,
qemu-system-aarch64 present). This session closes that honest limit:
re-prove the integrated tree boots and multitasks on real (virtual)
hardware. Verification session, not a new module.

## Positions

- **P1 (Verifier):** the re-proof runs on pristine scaffold sources —
  zero modifications to Gate-approved files. The image composition is
  like-for-like with the accepted session-6 proof: entry .S/.c, boot,
  hal-arm64, mem, alloc, sched, sched-arm64.S. kido-resonate is NOT
  linked in (not in the boot path; the re-proof measures the delta,
  not the whole tree).
- **P2 (Harness keeper):** reuse the proven session-6 recipe exactly.
  Raw binary via `-kernel` (gives x0 = DTB, unlike the ELF path),
  linked at the ACTUAL raw-binary load address 0x40080000. The load-
  address adjustment lives in a /tmp harness-only copy of the linker
  script — the scaffold's kido-link-arm64.ld is NOT touched (the
  session-6 record already recommended a Gate-noted comment update;
  that recommendation stands, still not done unilaterally).
- **P3 (Memory auditor):** the new risk on this path is the allocator
  consuming bare-metal memory for the first time. Analysis, not hope:
  QEMU virt DTB yields 1 region, 0x40000000 + 128 MiB (measured in
  session 5 against the real virt DTB). First-fit allocates low→high
  from 0x40000000. The image is linked at 0x40080000 — 512 KiB above
  the region base. Three 16 KiB stacks + 32-byte headers ≈ 48.1 KiB
  land at ~0x40000000–0x4000C060, an order of magnitude below the
  image. No overlap is possible at this allocation volume. D2 (the
  allocator not knowing image bounds) stays OPEN as a design gap —
  this run is safe by measured layout, stated as such, not by design.
  Post-link check: confirm `_image_end` and the first allocated stack
  address from the run.
- **P4 (Context purist):** kido-sched-arm64.S saves x19–x28, FP(x29),
  LR(x30), SP — callee-saved FP regs d8–d15 are NOT in the context.
  The task bodies (console_putc + yield in a loop) use no FP; at -O0
  nothing vectorizes across the yield. Honest constraint, stated:
  FP-using tasks are unsupported until the context grows d8–d15 (a
  future module, queued). kido-resonate's float eta is not in the
  boot path. The acceptance bar does not require what the design
  does not promise.
- **P5 (Conformance):** acceptance bar = the session-6 bar, unchanged:
  breath → `arch: arm64` → `kido_main: scheduler init` → `3 tasks
  created` → `entering scheduler` → `ABCABCABCABC` (12 marks, perfect
  round-robin interleave = the assembled context switch EXECUTED) →
  loud-halt spin on the emptied queue (timeout 124 is the expected
  exit) → ZERO exceptions under `-d int`.

## Challenges

- **C1:** does a /tmp linker-script copy violate "no Gate-file
  changes"? No — the scaffold file is byte-identical before and
  after; the copy is harness configuration, the same device session
  6 used. Verified by diff after the run.
- **C2:** kido_alloc_init walks a 128 MiB region to build the free
  list — a bounded linear pass, microseconds at emulated speed. No
  timeout risk; the 4 s QEMU window from session 6 had vast margin.
- **C3:** sched_init's bare-metal path reads kido_mem_regions() —
  populated only by the session-5 wiring (entry fill →
  kido_mem_discover). If discovery failed, n == 0 → KIDO_ERR_NO_MEMORY
  propagates LOUD from sched_init → kido_main → breath → HANDOFF.
  Failure would be visible on the console, never silent. (Session 5
  measured discover OK vs the real virt DTB: 1 region.)
- **C4:** the trampoline path (kido_task_trampoline) is unchanged
  since the accepted proof — the delta under test is strictly
  alloc_init + alloc-per-create. Any failure isolates to the
  integration, not the switch.

## Preserved dissent

- **D1:** empty-queue halt code mapping (KIDO_ERR_STUB_REACHED by
  documented mapping). The dedicated KIDO_ERR_NO_TASKS header code
  remains N8toriousAi's call — untouched by this session.
- **D2:** image-bounds reservation (reserve 0,0). Still open. This
  run's safety rests on measured addresses (P3), and the ledger must
  say so rather than imply the gap closed.

## Regression gate (ran before QEMU, all real, gcc 13.3.0)

- boot hosted self-test: PASS (kido_boot() → 0, AAAABBBBCCCC)
- sched self-test: 54/54 (34 adapted + 20 integration)
- alloc self-test: 31/31
- mem self-test: ALL PASS
- resonate self-test: 59/59 (regression; not in the QEMU image)
- hal / entry self-tests: covered in prior sessions, rerun below if time
