tidy: rewrite stale 18b/18c.x doc-headers to match shipped state
First half of the post-18-arc tidy-iter (per the new CLAUDE.md iter-cycle rule). Architect's drift review flagged module-doc headers describing 18b's leak-everything snapshot or 18c.x's "deferred" debt that has since shipped. Doc-only changes; cargo build clean, cargo test --workspace green at e2e=61, no behavioural change. - runtime/rc.c top-of-file header: rewrote from "Iter 18b deliberately stops at the layout and the alloc... programs leak every allocation" (false post-18c.3) to a stage summary spanning 18b–18e. Fixed `--memory=rc` reference (renamed to `--alloc=rc` in 18b's CLI work). Updated ailang_rc_inc / ailang_rc_dec block comments to point at `drop_<m>_<T>` and the worklist as the cascade owners, not at "18c will wire this up". - ailang-check uniqueness.rs module-doc: replaced the "deferred to later iters" block (which named 18c.4 + 18d as future work, both shipped) with a current "what this pass does NOT do" block. Cross-fn reasoning is still genuinely deferred; per-type drop fns and recursive cascades are NOT this pass's job by design (codegen does them, not the inference). - ailang-codegen emit_drop_fn_for_type doc + in-body comment: rewrote "Iter 18e replaces the recursive call with an iterative worklist free" to describe the actual shipped behaviour — the 18e (drop-iterative) annotation routes annotated types through emit_iterative_drop_fn_for_type; unannotated types stay recursive by orchestrator design (cheaper IR, no worklist alloc). Held back for the second half of the tidy-iter (pending the ailang-bencher determinism result): - DESIGN.md Decision 10 line 700 says modes are "mandatory" but lines 940–952 admit they're opt-in with deferred mandatoriness. The bench result either supports tightening the mandatoriness claim or backs down to "opt-in with performance benefit" — orchestrator-level decision blocked on the bench data. - Dynamic-tag partial-drop debt is captured in JOURNAL but should be surfaced in DESIGN as a known precision gap.
This commit is contained in:
@@ -810,10 +810,14 @@ impl<'a> Emitter<'a> {
|
||||
/// Recursion: when a ctor field's type is the same ADT (or any
|
||||
/// ADT in the workspace), the emitted call to
|
||||
/// `@drop_<owner>_<T>(field)` is recursive at the IR level and
|
||||
/// will overflow the stack on long lists. Iter 18e replaces the
|
||||
/// recursive call with an iterative worklist free; for 18c.4 the
|
||||
/// recursion is intentional and shallow — the assignment lifts
|
||||
/// the bound to "5-element list" fixtures only.
|
||||
/// will overflow the stack on long lists. The 18e
|
||||
/// `(drop-iterative)` annotation routes such types through
|
||||
/// [`Self::emit_iterative_drop_fn_for_type`] instead, which
|
||||
/// replaces the recursive call with a worklist push. ADTs WITHOUT
|
||||
/// the annotation continue to use this recursive form — the
|
||||
/// orchestrator's choice: opt-in iterative drop where the depth
|
||||
/// is known to grow, recursive cascade everywhere else (cheaper
|
||||
/// IR, no worklist allocation).
|
||||
fn emit_drop_fn_for_type(&mut self, td: &TypeDef) {
|
||||
let m = self.module_name;
|
||||
let tname = &td.name;
|
||||
@@ -862,9 +866,13 @@ impl<'a> Emitter<'a> {
|
||||
" %v{val_id} = load ptr, ptr %a{addr_id}, align 8\n"
|
||||
));
|
||||
let drop_call = self.field_drop_call(fty);
|
||||
// Iter 18e replaces this recursive call with an
|
||||
// iterative worklist push. For 18c.4 it stays
|
||||
// recursive — fine for the shipping fixtures.
|
||||
// Recursive call into the field's drop fn. If the
|
||||
// field's type is itself `(drop-iterative)`, that drop
|
||||
// fn is the worklist variant — recursion stops at one
|
||||
// level. Otherwise this is the unbounded recursive
|
||||
// cascade; safe only on bounded-depth ADTs (the
|
||||
// `(drop-iterative)` annotation exists for the
|
||||
// unbounded ones).
|
||||
out.push_str(&format!(
|
||||
" call void @{drop_call}(ptr %v{val_id})\n"
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user