Skip to content

docs: B2 closure-trio — milestone Closed 2026-05-09#24

Merged
cemililik merged 3 commits into
mainfrom
b2-closure-trio-2026-05-09
May 9, 2026
Merged

docs: B2 closure-trio — milestone Closed 2026-05-09#24
cemililik merged 3 commits into
mainfrom
b2-closure-trio-2026-05-09

Conversation

@cemililik
Copy link
Copy Markdown
Collaborator

@cemililik cemililik commented May 9, 2026

Summary

Phase B / Milestone B2 ("MMU activation, kernel-half mapping") flips implementation-complete → Closed via the canonical three-review closure trio. Pattern follows the 2026-05-07 B1 precedent.

Three closure artefacts

  1. Business retrospective — what landed, what changed in the plan, what we learned, adjustments queue, next.
  2. Security review — eight-axis adversarial pass; verdict Approve.
  3. Performance baseline — release ELF deltas, perf-harness release-build band (the first release-codegen baseline-of-record), regression check; verdict Merge.

Plus the canonical perf-harness output: docs/analysis/reports/perf-baseline-2026-05-09-B2-closure.md.

Headline numbers

Metric Value Δ vs B1 closure
Host tests 185 / 185 +33
Miri 185 / 185 clean +33
Release .text 22,384 (+364 vs post-T-015) +476 vs PR-#16 (T-014)
Release .rodata 2,944 (+16) +16
Release .bss 40,208 (+17,952; dominantly the 16 KiB .boot_pt reservation) +17,952
Boot-to-end p10/p50/p90 (release, 20 iter) 4.262 / 4.642 / 6.456 ms First release-build baseline-of-record
Single-run smoke 4.891 ms Within band
Audit entries introduced UNSAFE-2026-0022 / 0023 / 0024 / 0025 (+ bootstrap-Amendments + 2026-05-09 smoke-verification Amendments on 0023 / 0024) +4
ADRs accepted ADR-0027 (Kernel virtual memory layout) +1 (+ ADR-0033 / 0034 placeholder slots)

What's next

  • B3 — name TBD via first B3 ADR. Natural first task: PMM (Physical Memory Manager) bring-up — Mmu::map / unmap are live but FrameProvider has no real backing in v1.
  • Carry-forward items (non-blocking; recorded in the security review): UNSAFE-2026-0025 smoke verification (gates on first B3+ post-bootstrap caller); pre-existing PL011 "data written to disabled UART" guest-errors noise (queued as a follow-on B-phase BSP task).

Test plan

  • cargo fmt --all -- --check — clean
  • cargo host-clippy (`-D warnings`) — clean
  • cargo kernel-clippy (`-D warnings`) — clean
  • cargo host-test — 185/185 pass
  • cargo +nightly miri test — 185/185 clean
  • cargo kernel-build — clean
  • QEMU smoke — full demo trace through `tyrne: all tasks complete`; the new `tyrne: mmu activated` line in the expected position; no new fault classes
  • tools/perf-harness.sh --release --iterations=20 --report=2026-05-09-B2-closure — 20/20 valid; band recorded

Refs: ADR-0027, T-016

Summary by CodeRabbit

  • Documentation
    • Documented B2 milestone closure as of 2026-05-09 with business retrospective, security review, and performance analysis.
    • Updated roadmap to mark B2 as closed and B3 as the active milestone.
    • Added performance baseline, optimization review, and security audit reports for the B2 closure.

Review Change Stack

Phase B / Milestone B2 ("MMU activation, kernel-half mapping") flips
implementation-complete → Closed via the canonical three-review
closure trio. Pattern follows the B1 precedent (2026-05-07).

Lands:

- docs/analysis/reviews/business-reviews/2026-05-09-B2-closure.md
    What landed (T-016 Done; ADR-0027 Accepted; ADR-0033/ADR-0034
    placeholders reserved; PR #18 / #22 / #23 merged); audit-log
    surface (UNSAFE-2026-0022/0023/0024/0025 + Amendments); test
    counts (185/185 host + miri); smoke trace verbatim. What
    changed in the plan: B2 closed cleanly on first attempt
    (no smoke-regression rollback unlike B1) — the §Simulation
    discipline did its job. What we learned: ADR-0027's table
    walked the worst-case interaction; T-016's review-rounds
    surfaced compiler-side concerns but zero descriptor /
    encoding bugs at the architecture level. Adjustments queue
    (PMM bring-up next; PL011 init follow-up; MmuError::BlockMapped
    on first block-split caller; codify "simulation row → host
    test" mapping discipline). Next: B3, name TBD via first ADR.

- docs/analysis/reviews/security-reviews/2026-05-09-B2-closure.md
    Eight-axis adversarial pass. Verdict Approve. Key items:
    capability surface unchanged (no new userspace-reachable
    operation); MMU adds no new trust boundary in v1 (identity
    layout = transparent) but mediates every memory access
    architecturally; four new audit entries land cleanly under
    unsafe-policy.md §3 discipline; MapperFlush #[must_use]
    promotes "forgot to flush" from reviewer-attention to compile
    error; threat-model unchanged (v1 attack surface empty;
    ADR-0033/0034 placeholders deferred to B5+). Carry-forward:
    -1 (ipc_recv_and_yield Deadlock asymmetry closed by T-015),
    +1 (UNSAFE-2026-0025 per-call Mmu::map smoke verification
    pending B3+ caller).

- docs/analysis/reviews/performance-optimization-reviews/2026-05-09-B2-closure.md
    Release ELF: .text 22,384 (+364 from MMU surface) /
    .rodata 2,944 (+16) / .bss 40,208 (+17,952; dominantly the
    16 KiB .boot_pt reservation + 4 KiB alignment slack —
    explicit per ADR-0027 §"Bounded bootstrap frame budget").
    Source LOC ~11,290 (+1,010). Test count 185/185 host +
    miri clean. Release-build perf-harness band (the first
    release-codegen baseline-of-record): p10/p50/p90 = 4.262 /
    4.642 / 6.456 ms across 20 iterations; min 4.164, max 7.903,
    mean 5.110, stddev 1.016 ms. Single-run smoke 4.891 ms within
    band. Debug-build Δ pre/post-T-016: +1.5 ms p10/p50 (QEMU TCG
    translation-cache overhead at MMU bring-up; real-hardware
    activation sub-100 µs per ADR-0027 §Consequences). No new
    hot path (Mmu::map / unmap dead-code-allow in v1). Verdict
    Merge — re-baseline complete; no proposal this cycle.

- docs/analysis/reports/perf-baseline-2026-05-09-B2-closure.md
    20-iteration release-build harness output emitted by
    tools/perf-harness.sh; the canonical reference for B3+
    regression checks against B2's closing release-build perf.

Roadmap updates:

- docs/roadmap/current.md
    New 2026-05-09 banner under the prior 2026-05-08 banner
    (chronological; both preserved per the append-only
    discipline). Active-milestone line flips B2 → B3 (next; name
    TBD via first B3 ADR). Active-task line: none (T-016 Done +
    closed); next opens with first B3 ADR's Dependency chain
    section per ADR-0025 §Rule 1.

- docs/roadmap/phases/phase-b.md
    B2 §Status block flips "implementation-complete" → "Closed
    2026-05-09" with cross-references to the three closure-trio
    artefacts. Original status text preserved as historical
    record (per the same append-only discipline B0 / B1 followed).

Verification:
  - cargo fmt --check           clean
  - cargo clippy (host)         clean -D warnings
  - cargo kernel-clippy         clean -D warnings
  - cargo test                  185/185 host (unchanged; this is a
                                docs-only commit — no code touched)
  - cargo +nightly miri test    185/185 clean
  - cargo kernel-build          clean

Refs: ADR-0027, T-016
@qodo-code-review
Copy link
Copy Markdown

ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @cemililik, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Warning

Rate limit exceeded

@cemililik has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 43 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c7faacb1-5f70-4bba-be37-7cdab8be792e

📥 Commits

Reviewing files that changed from the base of the PR and between 6f7ac3d and 47ce27f.

📒 Files selected for processing (5)
  • Cargo.toml
  • docs/analysis/reviews/business-reviews/2026-05-09-B2-closure.md
  • docs/analysis/reviews/performance-optimization-reviews/2026-05-09-B2-closure.md
  • docs/analysis/reviews/security-reviews/2026-05-09-B2-closure.md
  • kernel/src/lib.rs
📝 Walkthrough

Walkthrough

This PR records the completion of the B2 (MMU activation) milestone with five documentation artifacts: a performance baseline report capturing boot-to-end timing metrics, a comprehensive security review covering eight audit axes and four new unsafe entries, a detailed performance analysis with kernel image size and timing deltas, a business retrospective summarizing what landed and key learnings, and roadmap updates closing B2 and transitioning to the B3 milestone.

Changes

B2 Milestone Closure Documentation

Layer / File(s) Summary
Performance Baseline Report
docs/analysis/reports/perf-baseline-2026-05-09-B2-closure.md
Boot-to-end timing baseline established for 2026-05-09 with harness metadata, measurement methodology, aggregated statistics (min/p10/p50/p90/p99/max/mean/stddev), and baseline verdict.
Security Review
docs/analysis/reviews/security-reviews/2026-05-09-B2-closure.md
Comprehensive audit of MMU activation scope covering capability correctness, trust boundaries, memory safety, kernel-mode discipline, dependencies, and threat model; introduces four new unsafe audit entries (UNSAFE-2026-0022 through 0025) and records verification outcomes.
Performance Analysis
docs/analysis/reviews/performance-optimization-reviews/2026-05-09-B2-closure.md
Detailed performance analysis including kernel image section deltas (.text, .rodata, .bss), source LOC metrics, canonical QEMU boot-to-end timing with P10 distribution, debug-build comparison, hotspot notes, and regression verification checklist.
Business Retrospective
docs/analysis/reviews/business-reviews/2026-05-09-B2-closure.md
B2 closure retrospective capturing what landed (T-016, ADR-0027, PRs #18/#22/#23), test counts, QEMU smoke trace with "tyrne: mmu activated" marker, documentation surface updates, plan changes, learnings on simulation discipline and integration bundling, and B3 adjustments.
Roadmap Updates
docs/roadmap/current.md, docs/roadmap/phases/phase-b.md
Marks B2 milestone closed (2026-05-09), transitions active milestone to B3 (PMM bring-up), updates T-016 to Done, and records closure-trio linkage and verification metadata in phase history.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • cemililik/Tyrne#22: Integration and performance harness bundle that is directly documented and linked in this PR's business retrospective and closure reports.

Poem

🐰 Whiskers twitch with milestone glee,
B2 closed, the MMU runs free!
Performance tracked, security blessed,
Now B3 awaits the next test.
Onward, dear Tyrne, let's bring PMM to light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: documenting the B2 milestone closure via the closure-trio of reviews, with the specific closure date of 2026-05-09.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch b2-closure-trio-2026-05-09

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request documents the closure of the B2 milestone (MMU activation) by adding comprehensive business, security, and performance reviews, and updating the project roadmap for the B3 milestone. Review feedback recommends simplifying the test count breakdown in the performance report for clarity and ensuring the description of the kernel entry boot sequence is consistent across all closure documents.


T-016's source diff: ~590 LOC HAL (`vmsav8.rs` encoders + `MapperFlush` newtype + trait return-type changes + 12 new encoder tests + 6 new MapperFlush tests + 3 contract-parity tests). ~600 LOC BSP (`mmu.rs` walker + `mmu_bootstrap.rs` activation routine + `linker.ld` extension + `main.rs` wiring). ~140 LOC test-hal (FakeMmu return-type updates + 6 + 3 new tests). ~580 LOC docs (ADR-0027 + memory-management.md + audit-log entries + closure-trio docs). Net ~1,910 LOC of *added work*; net source growth ~1,010 LOC reflects the doc / test ratio (docs make up ~50 % of the touched surface but live outside the LOC count's `*.rs` / `*.s` filter).

**Test count:** 185 / 185 (was 152 at B1 closure; pre-T-016 baseline of 159 included +7 from T-015's `cancel_recv` tests + PR-#18 coverage gap closure; post-T-016 adds +18 from T-016's 12 vmsav8 + 6 MapperFlush; +5 mid-arc from PR #22's harness host-test inheritance — actually mostly from `tyrne-hal` tests +12 = 30→42; +3 round-2 contract-parity tests in test-hal; the precise breakdown is in the [business retrospective §Test counts](../business-reviews/2026-05-09-B2-closure.md#test-counts-at-b2-closure)). All pass under `cargo +nightly miri test` 185 / 185 clean (~25 s wall-clock).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The explanation for the test count increase from 152 to 185 is difficult to follow. For clarity, consider replacing the detailed breakdown with a simpler summary by crate, similar to how it's presented in the business retrospective. For example:

"The +33 test increase breaks down as: +7 in tyrne-kernel, +17 in tyrne-hal, and +9 in tyrne-test-hal."

@@ -0,0 +1,115 @@
# Security review 2026-05-09 — B2 closure consolidated pass (post-T-016)

- **Change:** all committed code on `main` from `8dc433e` (PR #17 merge — T-015's `ipc_cancel_recv` recovery primitive, the last Phase-B-only commit covered by [`2026-05-07-B1-closure.md`](2026-05-07-B1-closure.md) §Post-T-015 amendment) through `b0035ce` (PR #23 merge — T-016 with all three review-rounds applied). The arc covers ADR-0027 (kernel virtual memory layout — `Accepted` 2026-05-08); the `MapperFlush` typed flush-token discipline at the `Mmu` HAL trait surface; the pure VMSAv8 descriptor encoders in `tyrne_hal::mmu::vmsav8`; the `bsp-qemu-virt::QemuVirtMmu` impl; the `mmu_bootstrap` boot-time activation routine; the `.boot_pt` linker reservation; the `kernel_entry` re-ordering (vector install → `boot_ns` snapshot → `mmu_bootstrap` → `tyrne: mmu activated` → GIC init → DAIF unmask → timer banner); the four new audit-log entries (UNSAFE-2026-0022 / 0023 / 0024 / 0025) with their bootstrap-Amendments and 2026-05-09 smoke-verification Amendments; and the doc-only / hygiene PRs #18 + #22's path-drift / banner / link sweeps.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description of the kernel_entry re-ordering in the "Change" section appears incomplete. It omits the "print" for the "mmu activated" message and the final "demo" step. For consistency with other documents in this pull request, please consider updating it to match the more complete description from the business retrospective: (vector install → boot_ns snapshot → mmu_bootstrap → tyrne: mmu activated print → GIC init → DAIF unmask → timer banner → demo).

cemililik added 2 commits May 9, 2026 10:32
Audit pass on the 2026-05-09 B2 closure-trio docs surfaced three
open / inaccurate items. All closed in this commit; no findings
remain unaddressed.

Closed:

1. **Track J §J-OBS1 — lift `#![deny(clippy::todo)]` to workspace
   lints** (B1 closure-trio §Adjustments item, still open as of
   2026-05-09 audit). The `clippy::todo` macro lint catches
   `todo!()` macro calls — never appropriate in checked-in code,
   regardless of crate. Original placement was kernel-local
   alongside `clippy::panic` / `unwrap_used` / `expect_used` (which
   ARE crate-specific because `tyrne-test-hal` legitimately
   panics in its host-test fakes). `clippy::todo` doesn't share
   that constraint and was kernel-local by inertia rather than
   design. Lifted to `[workspace.lints.clippy] todo = "deny"` in
   `Cargo.toml`; trimmed from `kernel/src/lib.rs` with a header
   comment recording the closure trail. The lint now applies to
   every workspace crate. Verified by `cargo clippy --all-targets
   -- -D warnings` clean.

2. **Test count miscount in B2 business retro** — claimed
   "+12 vmsav8 + 5 unrelated existing growth" for the hal crate
   delta. Empirical re-verification: `git checkout 6494ed2 --` (the
   pre-T-016 main tip) and `cargo test -p tyrne-hal` returns 25 (all
   in `timer.rs`); current HEAD returns 42; Δ = +17, ALL in
   `vmsav8.rs`. There is no "unrelated growth" — the prior
   `mmu.rs` had zero tests (`from_aligned`, `addr`, etc. are pub
   fns, not test fns), and the new `mmu/vmsav8.rs` module added
   17 tests at T-016 implementation time. Corrected the breakdown
   in both the business retro §"Test counts at B2 closure" and
   the perf baseline §"Source LOC" → §"Test count" sections, with
   the empirical verification cited inline so future readers see
   the closure-trail on this miscount.

3. **B1 closure §Adjustments closure-status audit** — the B2
   business retro listed new adjustments but did not audit the
   prior B1 list. Re-read the [B1 §Adjustments](../../../docs/analysis/reviews/business-reviews/2026-05-07-B1-closure.md#adjustments)
   list (7 items) and added a "B1 closure §Adjustments — closure
   status" subsection to the B2 business retro. Of 7 items: 6
   closed, 1 trigger-deferred (Track K — Live execution to
   comprehensive-review template, gates on next maintainer-
   initiated full-tree review). Item 7 (clippy::todo lift) is
   closed by item 1 of this commit.

Verification:
  - cargo fmt --check           clean
  - cargo clippy (host)         clean -D warnings (incl. new
                                workspace `todo = "deny"`)
  - cargo kernel-clippy         clean -D warnings
  - cargo test                  185/185 host (unchanged — only
                                lint surface + doc text edits)
  - cargo kernel-build          clean

This commit completes the 2026-05-09 B2 closure-trio cleanup; no
further open items from the prior B1 → B2 arc.

Refs: ADR-0027, T-016
PR #24 review-round (gemini-code-assist; sourcery / coderabbit /
qodo all rate-limited so no substantive feedback). Two medium-
priority findings, both stylistic / consistency. Applied:

1. **Perf baseline §"Test count" — simpler per-crate breakdown.**
   The post-cleanup text still embedded the +33 delta inside a
   parenthetical arithmetic chain that read densely. Gemini
   suggested the business retro's per-crate sentence form. Adopted
   that shape: "+7 in tyrne-kernel, +17 in tyrne-hal, +9 in
   tyrne-test-hal". The audit-correction note (the closure-trio
   re-read finding that the prior +12+5 split was a miscount)
   stays; the headline count is now scannable.

2. **Security review §"Change" — kernel_entry sequence consistency.**
   The boot-sequence list omitted "print" after `tyrne: mmu
   activated` and the trailing `→ demo` step that the business
   retro carries. Aligned both: now reads "vector install →
   boot_ns snapshot → mmu_bootstrap → tyrne: mmu activated print
   → GIC init → DAIF unmask → timer banner → demo" — byte-stable
   with the [business retro §"Smoke trace"](../business-reviews/2026-05-09-B2-closure.md)
   and the [boot.md §Stage 3 sequence diagram](../../../architecture/boot.md).

Verification:
  - cargo fmt --check           clean
  - cargo test                  185/185 host (unchanged — doc-only)

This is the final closure-trio cleanup. PR #24 ready to merge.

Refs: ADR-0027, T-016
@cemililik cemililik merged commit 32bf3f1 into main May 9, 2026
6 checks passed
@cemililik cemililik deleted the b2-closure-trio-2026-05-09 branch May 25, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant