corpus: add fibonacci (numeric recursion) app #41
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/041-corpus-add-fibonacci-numeric-recursion-app"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
corpus: add fibonacci (numeric recursion) app
Along the way:
Touches 32 files:
P2_5.md,current-state.md,docs/impl/lowering/00-lowering.md,docs/impl/runtime/README.md,src/rust/crates/ck_driver/src/compile/mod.rs,src/rust/crates/ck_driver/src/compile/test_compile.rsand 26 more.The lint was right. Fixed the code in
src/rust/crates/ck_driver/src/compile/typecheck.rsand dropped the allow onallow.It said what I assumed. Reworded in
src/rust/crates/ck_driver/tests/lists_run.rsso it names the input that broke it, which is what the bug report will need.Good. Small enough to read in one sitting, and
src/rust/crates/ck_driver/src/compile/typecheck.rsis easier to follow than it was.@ -0,0 +211,4 @@/// pushing any diagnostic into `diags`. The body is located by `FnId` through/// `bodies_by_fn`; a decl the resolver never bound (no scope entry, no body, no/// lifted signature) is skipped — it was already diagnosed upstream.#[allow(clippy::too_many_arguments)] // mirrors `check_fn_body`'s own irreducible input set: the decl, its source, scope, resolved bodies, the project tables, the interner, and the diagnostic sink.An allow attribute on
allow. Is the lint wrong here, or is the code? If it is the lint, a one-line reason beside it stops the next person deleting it, at src/rust/crates/ck_driver/src/compile/typecheck.rs:214.@ -0,0 +118,4 @@.arg("--stdlib").arg(&stdlib).status().expect("spawn the `ckc` binary")The expect message on
expectis the only thing a user sees if this fires. Does it say what they should do, or only what we assumed?, at src/rust/crates/ck_driver/tests/lists_run.rs:121.Second read on
src/rust/crates/ck_driver/src/compile/typecheck.rs. Nothing to add.A List value builds from a literal and an element reads by index, end-to-end under ckc test. Full vertical: new HIR list-expr node (ck_hir) forces resolve-lowering (ck_resolve) + type-check (ck_types synth_index_at) + Floor IR + codegen -- the parser already produced the CST list/index nodes. Representation (interim, like S2 host-alloc): a (ptr,len,cap) header; the element buffer is ck_rt_alloc'd in the actor arena, reclaimed wholesale. Element stride = element type width (Int 8B, String 16B, variant 8B tag, record = sum-of-fields via P2.2). The static-N bounded slot (capacity from the type-level bound per arenas.md) lands with run-path type-checking + full M1 -- documented deferral; ckc run/test are resolve-only so there is no static N yet. Lowering: list literal [a,b,c]/[] allocates count*stride, stores each at its offset, len=cap=count. Index xs[i] loads at base + i*stride (in-bounds). An indexed record element field-projects (xs[0].field) -- the greeter path. New codegen/list.rs. Gate: tests/corpus/lists + Docker-gated lists_run -- list_indexes (Int elements) and list_of_records_projects ([Point{..}][0].y). Front-end clean, allow-listed. Out (cited): .append/.clear/mutation (P2.6, needs mock state), static-N sizing + bounds enforcement (run-path typecheck), OOB Panic::raise (R5), list methods, String == (P2.5), mocked effects (P2.6). Gates (1.96): fmt clean; clippy 0/0; cargo test --workspace green; greeter/helloWorld unchanged; lists fixture green. cka: new files clean; +1 advisory lcom4 on the type-checker Walker (visitor-pattern metric mismatch, cka not gated) -- tracked for the cka-wiring/burndown cleanup.