fable-cleanup #45

Merged
st merged 94 commits from fable-cleanup into main 2026-07-15 01:08:27 +02:00
Owner
No description provided.
st added 94 commits 2026-07-15 01:06:40 +02:00
Six-agent whole-compiler audit synthesis + 4-phase migration plan.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Self-review probes found 2 latent segfault families, fixed by design.
Plan + decision tables: docs/plans/finish-phase-2.md
Pin: test_prompt_assoc_const. Session-instance gap ledgered (plan F7).
Inherited sets prune to principal constraints before BOTH views,
fixing the promoted-entailed-pair segfault (plan F1, singleton).
Members gain ambiguity check, protect-set, inferred-Flat;
union-set pruning fixes the F1 segfault, SCC half.
Fixes the constrained-private segfaults (plan F2, F9); 6 JIT pins.
Review blocker R1 (values generalize mid-body — never default there) +
R2 (baking unsound when seeds refresh); 7 pins, suite 1078.
Decision table: docs/plans/finish-phase-2.md
r3_prog_ctor_d2 gap closed (promoted to expect). local_modules /
dotted_path_of / flatten_namespaces deleted; symbols derived via Mangle.
Payload-sibling gap discovered and pinned; probe-vehicle lesson in the plan.
pm_* dies; Dependency runs in compile_package; instance owner tags zip
structurally (map2, loud on mismatch).
Own-children scoped to package_units (cross-package child adoption leak,
pinned); named invariant failure on instance-tag mismatch.
Ordering pin: fd source pinned after the call now improves the literal
(pre-R3: NoInstance for the defaulted participant).
Error-kind delta pinned (eager/quiescent unify consistency); fire-order
documented; obligation.ml phase map; alias/comment residue. Recorded the
refined design boundary: participants are resolution-relevant, assoc types
are deliberately dispatch-inert (not sugar over fundeps).
session_ns rebuilds on redefinition (review blocker, pinned); lifted decls
join the fold; mli type equation; export trim.
type_defs keyed by structured Types.qualid (mangle confined to codegen +
size/matching layout bridge); refs/annotations carry Syntax.type_origin
(VariantLit/QualifiedVariantLit merged; StructLit threaded; TResolved for
annotations; patterns via scrutinee qualid). Fixes same-named-type collisions
across modules. Reviewed (adversarial diff) + fix round folded in. Suite 1185.
Plan+decision tables: docs/plans/type-identity-uniqueness.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
VVariant carries the enum's structured owner (OInstance/ONamespace) instead
of a mangled name; variant/type-namespace refs resolve to the structured
qualid. Deletes the hoisted_flat_ref/flat_of_tref reverse-map and the
register_type_def dual-key. Suite 1185. Plan docs/plans/nested-type-identity-debake.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Disambiguate DuplicateVariant message by readable owner (namespace path /
instance head), not the mangled symbol. Reviewer decision table in the plan.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Struct/enum field-type annotations are structured (TResolved); size.ml and
codegen field-layout resolve nominal types by their structured qualid, not a
bare source name, so infer+size+codegen agree per-owner. Fixes the cross-module
layout collision (a same-named unboxed field miscompiled to garbage). size.ml is
mangle-free; the infer adapter's string table + bare alias are gone. Reviewed
(one fresh-context reviewer, 5 both-builds probes) + fix round: nested-enum-payload
collision + dead codegen alias ledgered (F10). Suite 1188.
Plan docs/plans/structure-field-type-annotations.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Namespace/instance hoisted type defs keep their SOURCE name in struct_name/
enum_name (the structured origin is their identity; lowering derives the flat
symbol) for every expressible case; the instance-nested case stays flat (F).
The three session seams that keyed type redefinition by the name (repl node key,
ns_symbols_under drop-set, land_unit dedup) now key by the owner-derived symbol.
The codegen ~base alias is KEPT (serves nested-pattern bare lookups — C rides
with B). Reviewed + fix round (land_unit blocker). Behavior-preserving; suite 1189.
Plan docs/plans/type-backend-field-debake.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
codegen extract_bindings derives a nested subpattern's type from the parent
variant's payload under the scrutinee's type-arg substitution (retiring the
ownerless subpattern_field_ty); matching keys the payload enum_lookup by the
structured qualid. Both per-owner, so the codegen ~base source-name alias is
DELETED. A same-named enum as a nested variant payload now evaluates correctly
(pin -> expect_lib=11). Reviewed + fix round (payload arg-propagation blocker).
Suite 1190. Plan docs/plans/nested-payload-debake.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A bare (anonymous) program's top-level types are now genuinely path-less
(SInteractive), not module-rooted under the synthetic filename: bare -> resolve
with self_name=None and skip stamp_owner (the two agree). Reviewed CLEAN
(byte-identical IR; a latent same-named-import collision is fixed). Suite 1190.
Plan docs/plans/bare-program-sinteractive.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Types in a namespace nested inside an instance body get a STRUCTURED composed
identity: OInstance/SInstance gain an ns (namespace-path) field, so
origin_of_local never returns None and the last (mangled, None) type currency
is gone. register_module_decl's instance arm descends into nested namespaces,
registering their variants under the composed owner — closes the r4 gap
(gap -> expect=7). Mangle.symbol composes byte-identically (reviewer-verified
via byte-identical LLVM). Reviewed CLEAN. Suite 1190.
Plan docs/plans/composed-origin.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fn_decl/const_decl gain scope : Ir.mscope (mirror of the reference-side mscope);
Ir.decl_component derives a value decl's flat member component from (source name,
scope). Populated at the namespace hoist site via mscope_of_lns while the .name
stays mangled -> inert. Sets up the DB flip. Suite 1190.
Plan docs/plans/fn-decl-scope.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hoisted namespace/instance fn/const decls keep their SOURCE name; their flat
symbol derives at lowering from the structured scope (decl_component), like a
reference's. Every identity site across dependency/infer/specialize/codegen/repl/
engine re-keyed to the component (byte-identical values). resolve no longer
mangles a fn/const name. Reviewed + fix round (const_closures blocker twin of
const_gens; module_sig symmetry). No mangled string is any decl's identity
during analysis. Pins: two-namespace same member (=30); namespace const closure
(=42). Suite 1191. Plan docs/plans/fn-decl-scope.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop Infer.thread_sccs from the .mli (internal-only callers) and delete the
dead Namespace.iface_method_names (zero callers).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The ONE enumeration of ty's structural arms; consumers handle their own leaves
(scalars/TVar) + nat policy and delegate the structural arms. Adopted in
apply (instantiation), iter_vars, collect_bound_tvars, and show_with_names'
collect — collapsing ~4x the repeated arms. Behavior-preserving; suite 1192.
Foundation for the F6 cluster (nat unify, TClosure move, types.ml split).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
F8 byte-vs-word walker unify = false duplicate (repr/generality/measure/
failure-policy diverge). F9 premise false: codegen reads type_params/
propositions to lay out runtime evidence dicts (backend is repr-mono but
iface-poly). Harvest banked; suite 1192.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
st changed title from WIP: fable-cleanup to fable-cleanup 2026-07-15 01:08:17 +02:00
st merged commit 8260d76dc4 into main 2026-07-15 01:08:27 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
st/amelie!45
No description provided.