P3.1: carv-rt — `_start`, syscall wrappers, budget-backed user heap, panic → exit, `println!` #158
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 373 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.354
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #158"
general
weight: 0.35
garrickdabbs
P3.1 asks for a user-space runtime,
carv-rt, with_start, syscall wrappers, a heap that grows from the budget, panic → exit andprintln!through a console cap. Its acceptance criterion is a hello-world program built separately from the kernel.crates/carv-rt-
entry!(main)defines_start. It runsmain, then exits by destroying the thread cap ininit::THREAD.-
syshas one wrapper per syscall and perinvokemethod, returningResult<_, SysError>. Unassigned error codes are kept as raw values.- The global allocator is
linked_list_allocatorover[0x4000_0000, +1 GiB). It starts empty and maps pages on demand withADDRESS_SPACE_MAP, so each page is charged to the address space's budget. When the budget runs out,allocreturns null.- The panic handler prints the message and exits. It is guarded against recursive panics.
-
println!writes todebug_putc. Afterset_console_cap(slot)it sendsWRITEmessages to that endpoint instead, batching up to 40 bytes per message. This encoding is defined only incarv-rtand is not part of the frozen ABI, so P3.2/P3.4 can change it.- The
syscallasm,sysandruntimeare compiled only fortarget_os = "none". Heap growth, message encoding, status decoding and the spin lock are pure and have host unit tests.userland/hello: prints, sums some squares and grows the heap to 1 MiB.userland/init: its hand-rolled syscall code is replaced bycarv-rt. Its serial output strings are unchanged.userland/init/linker.ldmoved tocrates/carv-rt/linker.ld. Both programs'build.rspoint at it.-
buildnow builds every entry inUSERLAND_PACKAGES.-
assemble_isoandbuild_image_withtake aroot_taskpackage.- There is a new
hellosmoke scenario that bootshelloasboot/initand asserts its output, including the heap growth. That makes 8 scenarios.-
build.ymlgains a clippy step for-p carv-rt -p init -p hello --target x86_64-unknown-none. Host clippy skips that code, so thesyscallasm was otherwise unlinted.- README, CLAUDE.md, PLAN.md §4/§7/§11 and the CHANGELOG are updated.
Review notes
docs/abi.mdandcrates/carv-abiare untouched.exit()assumes the thread cap is ininit::THREAD, which the kernel'screate_processsets for every process. Threads started withTHREAD_STARTin a shared CSpace should callexit_thread(slot).hello, but no smoke scenario covers it.task: P3.1
<!-- START COPILOT CODING AGENT SUFFIX -->