Repository navigation
MQ-1: list literals lower whole as their free-monoid construction, through the one value reader - #12208
Conversation
…d arguments no longer refuse the whole module gunbc#12145 stopped the operand reader narrowing a sequence to its left element, which had read h(q: a) as h and [a] as [. body_lower_call_arg_value read every argument with that reader alone, so a nested call, record, caret symbol or parenthesised group became call_argument_unread and its whole module refused normalize. An argument's value is now lowered by body_lower_value_lowered (the field-initializer / if-condition reader), with the operand reader as fallback. A parenthesised group lowers to its inner expression instead of its first atom. A list literal anywhere in an argument value still refuses, at the list (body_lowering_reason_list_literal_unlowered): body lowering has no lowered form for a list literal yet, so reading it would trade a refusal for a silent drop. Witness: v2.test.claim.namespace_xl0.call_argument_value_resolve_refusal. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e no longer refuses the whole match
body_lower_match_scrutinee_optional read the scrutinee with the operand reader
alone: before gunbc#12145 match t(p: x) {..} narrowed to t, after it the match
refused as match_arm_navigation_refused (64 of the 133 still-refusing sample
modules). The scrutinee now goes through body_lower_value_lowered, operand reader
as fallback, refusal propagated. Witness claim: an undeclared name inside a call
scrutinee refuses at resolve at its atom.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…b.com/gunb-ai/gunbc into session/silent-dove-314
…ments read through the value reader Stacked on #12173 (call arguments and match scrutinees via body_lower_value_lowered). body_lower_operator_operand reads a non-operator operand whole via body_lower_value_lowered before refusing operator_operand_unread; a function value in argument position is carried as its preserved shell under value_carried_unlowered (the field-initializer disposition) instead of refusing its module as call_argument_unread (weather.dag, gen-one's first fatal). Claim v2.test.claim.namespace_xl0.value_position_whole_read with production-route shape assertions; RFM row fold_rewrite_regression_visible_only_at_whole_route_identity_diff. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… outcome, not dropped (review 70746) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rom the #12198 srv1 diff) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e_query and node_subtree_nodes, no untyped edge field access (entry resolve refused '.target' on T) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…RFM receipts folded into lowering_accessor_collapses_a_sequence_operand as an exposure/coverage gap, not a new regression row (side-chat review) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ough the value reader [] -> v2.std.algebra.freemonoid_empty(); [e] -> freemonoid_singleton(item: e); [e1..en] -> right-nested list_append(left: singleton(e1), right: ..). One producer (body_lower_list_literal) reached from body_lower_primary_expr, so every value position gets it; each element lowers whole via body_lower_value_lowered and an element that cannot lower refuses located at it. The call-argument list_literal_unlowered refusal is deleted. Declares freemonoid_singleton (the free monoid's generator embedding) beside freemonoid_empty. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… shape of the operator_operand_unread files; the bare call lowered before the fallback (srv1: M1/M2 stayed green) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…eclared body name refused at its atom; operator-operand fallback and its non-discriminating claims dropped (owned by #12194) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tionally so the rostered named-label drop does not red it Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…; lambda claims enrolled expected-red as the MQ frontier; shape claims read an ingest without the lambda fixtures; RFM receipt updated Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…'s landed versions Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…branch hunk the squash did not land is not this PR's) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-resolve under #12194's match-scrutinee controls; list_literal_has_no_lowered_form records the climb and cites the renamed and new claims Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…clared; move freemonoid_empty, freemonoid_singleton, list_append, list_snoc_item there (delete-first, no re-export) and repoint every consumer v2.std.algebra imports v2.std.node, so v2.std.node's own list literals lowered to v2.std.algebra calls would close a node -> algebra -> node cycle; v2 collapses onto dag/std. Adds the self-reference claim: a module std.algebra's own list literals resolve to its own qualified names, and its twin without list_append refuses at resolve. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…bridge std_algebra.rs (FreeMonoid + list_snoc_item) replaces the v2_std_algebra.rs bridge and normalize's FreeMonoid-only stub The emitted 03_normalize, 03_body_producer and use_site_verdict now import list_snoc_item from std.algebra; their transport rows, shim libs and normalize's declared source refs point at the one bridge (review 70892). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Addressed review 70892 in 6350074. The finding was right. The emitted What changed:
Rung: this is consistent by inspection, not by execution. I haven't built these instruments; the build that exercises them is the self-host behavioral run. — sent from lively-koi-275 |
…ebra FreeMonoid reference, elements positional in order -- with one infer introduction case Reverses the right-nested list_append lowering: std.literal_elaboration UnicodeScalarSequenceUnfold names the flat list-literal introduction as the language's FreeMonoid introduction and rejects cons^n on cost and emitter fuel, so the nested form forked that authority (ruling: gentle-koi-724 / neat-boar-16). 04_infer types the introduction: every element unifies to one T (compared with provenance stripped), a differing element refuses located at it, [] stays on the GroundingNotDerived frontier. freemonoid_singleton is deleted (no consumer left). Claims: flat shape reader, 200-element depth control, infer introduction controls; the std.algebra self-reference twin now omits FreeMonoid itself. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
briansrls
left a comment
There was a problem hiding this comment.
Exact-head re-review of 56a00a6b7765aad1d78889cac502bc4ae06350ae: APPROVE.
Review 5311185213 is closed.
-
Element-type equality is now structural rather than atom-only.
infer_type_equal_ignoring_provenancedelegates to the existing exact structural equality fold; the supplied nested-equal case establishesFreeMonoid<FreeMonoid<Int>>, and the nested-mismatch case refuses at the differing inner list. -
The positive inference contract now reads the exact
FreeMonoidargument. The Int claim requiresFreeMonoid<Int>, and the Bool twin both establishesFreeMonoid<Bool>and rejectsFreeMonoid<Int>. -
The std.algebra bridge transition has executed rather than remaining source inspection.
use_site_verdictpasses on both the PR and the main control;body_producerpasses here while main stops at its independently stale claim-run path;03_normalizereaches the same unrelated emitted-crate E0308 on both. The shared bridge itself remains unchanged at this exact head, and the former count literal is now an identity join. That closes the pairing concern without over-reading the unrelated normalize failure as a successful behavioral receipt.
The #12202 integration is also complete: the canonical list-introduction reader recognizes the exact std.algebra.FreeMonoid head in both the pre-resolve qualified-spine form and post-resolve declaration-reference form; application_head_read returns NotApplicationHead before ordinary application classification. Controls establish that a lowered list argument and a resolved list introduction are not applications, while the call enclosing a list remains an application.
The flat representation, whole-element ordering controls, 200-element depth control, first-only/drop-head/reversal mutations, self-reference qualification after #12240, and the 0/35 list_literal_unlowered result are mutually consistent. All five exact-head checks are green, including the floor and emitted build.
The stated residuals are honest and do not block this slice: the seven-test canary remains downstream of #12210, and target emission of the 200-element value within fuel remains a separate frontier rather than being claimed here.
Non-blocking documentation cleanup: the PR body still contains the older wording that the std.algebra self-reference is expected-red and that the flat head needs a re-run. Both are superseded by the evidence at this head and should be refreshed before merge, but they do not reopen source review.
… (survives #12208 deleting the list-literal cause) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…12298, #12184, ...) - self-host instruments take main's versions (#12275 links only emitted bytes); #12208's std_algebra.rs bridge is deleted with the rest of the std-bridge shim directory it lived in. - body_lowering_fold keeps main's anonymous_binder + symbol_intern_lexeme imports with lower_list_introduction; native_frontier_ratchet (#12184) repointed to std.algebra. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… into session/zesty-stag-363 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…required-regen (the moved freemonoid_empty / list_append / list_snoc_item); remove a helper script the previous merge commit picked up by accident The merge queue dequeued #12208 on 'Stage0 mirrors match what this seed emits' (FAIL generated surface drift: std_algebra.rs). Regenerated at a033fa1: round 1 drifted on std_algebra.rs only, round 2 reported first_generation_equal=true (planned=161 adjudicated=161). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ucer class v2 Foundation Mgr attributed gunbc#12210's cost by a controlled comparison this lane did not run: v2.std.compilers.target_model at 43 seconds on main, 54 with #12208 alone, and a TIMEOUT at 30 minutes with #12208 plus #12210, so the cost arrives with #12210 and not with #12208. A declaration split flagged 54 declarations, of which 26 exceed a 2-minute cap against about 0.2 seconds without #12210, and every one of the 26 is function literals passed as ordinary call arguments and nested inside each other. Cost multiplies per nesting level, about 6 seconds at two levels to timeout at five or more. That is corroboration rather than a second telling. It reaches the same multiplicative shape this row measured -- 0.2, 0.6, 3.2 and 24.1 seconds over depths 1 to 4 against a nested-match control flat at 0.2 -- by a different method, on a different subject, in a different binary. Two independently derived measurements agreeing on the shape is why the attribution is admitted without re-deriving it, and why the ON/OFF pair prepared here is WITHDRAWN UNRUN: spending a build to re-derive an attributed cause is the redundant work DESIGN section 2 forbids. The repair in progress has each function literal lower its own body ONCE instead of re-entering the general walker, which names a body-lowering boundary. So by this row's own refinement clause it refines INTO body_producer_work_is_not_bounded_by_its_declared_input rather than standing beside it, and that row's confirmed specimen is restored by a different route than the census evidence withdrawn from it yesterday: the candidate that survived is re-entry into a general walker, while the separating experiment's two candidates, node count and spine depth, remain refuted. The ordered-choice and memo candidates are now SUPERSEDED rather than merely unproven, and parse is not the paying stage. Neither row reports the class as climbed. The repair is unpushed, its verification is the 54 flagged declarations rerun against #12208 alone, and 28 of those 54 have no stated disposition. The tiny fixtures stay as the INDEPENDENT regression ladder: the nested ladder must return to about 0.2 seconds AND the nested-match control must stay unchanged, because the ladder alone is satisfiable by a policy cap. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…es.dag keeps main's any, moved fns stay on std.algebra Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n's; the retired lambda / fn-literal chunks stay retired; warm producers kept
…roducer roster keep the stack's #12210 retirements and additions; std_algebra.rs mirror verified by --required-regen
…idue, not in main's #12208 and not part of this PR Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… duplicate RFM; partition 21/3 Addresses GitHub review 5369451225. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MQ-1 (work item adhoc-6c4a2f19-afa). The base is main.
What changes
A list literal is the flat free-monoid introduction.
List<T>isstd.algebraFreeMonoid<T>(dag/std/algebra.dag).[e1, .., en]lowers to one Transform. Its head is the resolved reference tostd.algebra.FreeMonoid, and its remaining positional children are the elements in order.[]is the Transform with the head alone.std.literal_elaborationUnicodeScalarSequenceUnfold. It names the flat list-literal node as "the language's canonical FreeMonoid introduction" and rejects a cons^n nesting for two reasons: it is O(n²) under a sequence-backed carrier, and n-deep it exceeds the emitter's bounded recursion fuel.list_appendoverfreemonoid_singletoncalls. That forked the authority above. Readingstd.literal_elaborationfor the caret slice surfaced it, and the gentle-koi-724 / neat-boar-16 ruling reversed it to the flat form before landing. The nested lowering andfreemonoid_singleton(left with no consumer, §3c) are deleted.body_lower_list_literal, reached frombody_lower_primary_expr. Every value position reads throughbody_lower_value_lowered, so all of them get it: call args, field inits, let values, operands and scrutinees. There are no per-position fixes.body_lowering_reason_list_element_unlowered).body_lowering_reason_list_literal_shape_unread.v2.compiler.infer,infer_transform_freemonoid_introduction. It runs before application inhabitance, because the head is a type and not a function.infer_list_element_type_mismatch).FreeMonoid<T>.[]derives no T here: it stays on the counted GroundingNotDerived frontier rather than receiving a guessed T.std.algebra, notv2.std.algebra.v2.std.algebraimportsv2.std.node, so the list literals inv2.std.nodeitself would otherwise close a node → algebra → node cycle.freemonoid_empty,list_appendandlist_snoc_itemmoved intostd.algebranext toFreeMonoid, delete-first with no re-export.std_algebra.rs(review 70892).body_lowering_reason_list_literal_unloweredand its route).list_literal_has_no_lowered_formrecords the climb, the form and the reversal.Evidence
v2.test.claim.namespace_xl0.list_literal_value_loweringis production-fed throughmodule_roots_from_source_root_ingest. Its reader decodes only the flat form. It covers:std.algebramodule's own list literals should resolve to its ownFreeMonoid, and its twin withoutFreeMonoidmust refuse located at thestd.algebra.FreeMonoidhead.type FreeMonoid<T> = Empty | Cons { head: T, tail: FreeMonoid<T> }, and v2 resolve refuses it unbound atT. v2 type-parameter binders:<T>lowers onto an Arrow type-binder edge, resolve scopes it, infer instantiates it #12217 scoped<T>for fn signatures only. A type declaration's binders are trigger (1) ofgeneric_type_parameter_resolved_as_an_ordinary_atom_in_v2, which v2 type binders: a type declaration's <T> rides on its member under one unauthorable edge (trigger 1) #12240 lands. This is not a list-lowering defect: the twin shows the head is located and bound. The same gap means the realdag/std/algebra.dagrefuses at resolve on its own generic types until v2 type binders: a type declaration's <T> rides on its member under one unauthorable edge (trigger 1) #12240 lands.v2.test.claim.infer_list_introduction(supplied inputs at the infer interface; the head is supplied in resolved form viadeclaration_reference_node, per Resolver-minted declaration references carry an unauthorable marker; the reader never keys on the spine shape a literal also has #12220's marked references):[1, 1]infers toFreeMonoid<Int>;[1, true]refuses at thetrue;[]derives no type.reference_conservation: the list-argument control conserves every element.call_argument_value_resolve_refusal: the list arguments reach resolve.54d56d5(baseline): the claims passed and the first-only mutant reddened them. 0 of 35 paths refused onlist_literal_unlowered. The next layer is function literals in value position (MQ-1: function values in value position (lambdas and fn literals) lower to the generic fn Arrow; unwritten types are fresh type parameters #12210).🤖 Generated with Claude Code