Repository navigation
MQ-1: a positional fold step lowers like the named form (position from std.algebra's fold signature) - #12272
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 to; its binder is scoped at resolve 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>
…ue Arrow producer for fn literals to reuse Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…value Arrow producer; body through the named-fn body lowering 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>
…h arm) must normalize and resolve Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…searches (a let-bodied fn literal under a non-fold callee no longer answers the enclosing body) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ue producer and fold_lowering unfolded (single-atom bodies read; record-construct bodies well-formed) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…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>
resolution): keep this PR's fold-seam row; take #12210's comment wording
|
Re review 71734 ( — sent from merry-hawk-532 |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ssion/merry-hawk-532
|
Re review 71746 ( — sent from merry-hawk-532 |
… names built from its own domain labels), not by parsing a spelling; the prefix predicate is deleted; the RFM row names the encoding as its population (review 71746 on #12272) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ssion/merry-hawk-532
…e fold, positioning edges/path and rename folds were O(n^2) (review 71751, DESIGN §6 bare minimum cost) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts: # src/v2/workflow/floor_pure_producer_share.dag
…ssion/merry-hawk-532
…its seam; value_read_refusal re-pointed to a function-valued body The base-vs-head consumer run found body_lower_fold_family_call_first returning fold_lowering's seam Loop without lowering the call's other arguments, so fold(map(s, <unlowerable>), ..) Accepted with the refusal lost (value_read_refusal a_fold_refusal_inside_a_let_value_propagates..). The call is now lowered once through the ordinary dispatch and its refusal propagates before the seam stands. The seam dropping collection/init stays MQ-5's (#12272). The other value_read_refusal specimens used a plain fn literal, which #12210 lowers; they are re-pointed to fn(y) { fn(z) { y } } / l => m => leaf(l), still refused (arrow_body_is_function_value_unmodeled) until #12283. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ssion/merry-hawk-532
# Conflicts: # src/v2/compiler/body_lowering_fold.dag
…ssion/merry-hawk-532
…-site content-hash claim still sees exactly its two vpw_site sites Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ssion/merry-hawk-532
# Conflicts: # src/v2/compiler/fold_lowering.dag # src/v2/workflow/floor_expected_red.dag
briansrls
left a comment
There was a problem hiding this comment.
Verdict: APPROVE e2f97bb
Independent exact-head review, not a proxy acceptance of dashboard review 72020. No blocking finding in MQ-1. collection_fold_shape replaces both duplicate collection templates; its ReceiverSelf-first param_types supplies the step position through template_step_position rather than a literal offset. I checked declared_arg_types_for_method and build_type_substitution at this head: both remove a leading ReceiverSelf before pairing ordinary method arguments, so adding that slot does not shift those consumers' init/step contract. The Rust delta is the generated form of the .dag template/reader change, not an undeclared handwritten rule.
The positional reader counts each direct arg once and stops at that arg rather than searching inside its value; a named actual in that source position is not reclassified as positional. Named and positional lookup converge on the same fold_step_form_at and existing function-value reader. A positional step that is a reference remains FoldCallStepFormUnresolved. The named-only frontier for fold_list/fold_list_right/fold_node is explicit rather than inferred to work from fold's row.
The current diff does not restore chunk_15 or the retired #12210 rows. Its one expected-red rename describes the still-observed reference-conservation failure, with MQ-5 owning the capability to carry collection and init in the Loop. Reaching fold lowering is not an end-to-end passing fold; this approval does not call it one.
I credit the reported 18 passing fold claims, named-only mutation failing positional parity while the named positive stays green, and the 11 primitive-signature claims. I do not credit a complete Rust-suite base/head equivalence measurement: the body says the base worktree was removed during that run, so the absence of newly listed failures is weaker evidence than a controlled completed comparison. The source consumer trace and the targeted controls are the evidence used here. Exact-head workflow 36368968596 succeeded; fixed-point enforcement remains on the merge-group route. No local rerun performed by this reviewer.
GitHub currently reports this branch non-mergeable. Conflict repair or a main merge changes the head and requires a delta review before enqueueing.
|
Correction to review 5338362885's mergeability note: I found that the normalized PR summary can turn GitHub's unknown mergeability result into false. I have not established a conflict on this branch and withdraw the statement that conflict repair is required. Do not re-merge solely because of my note; confirm GitHub's completed mergeability result. The independent APPROVE at e2f97bb and its stated evidence/operand-conservation limits remain unchanged. |
…already here, identical) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MQ-1: a positional fold step lowers like the named form
fold(xs, 0, fn(acc, y) { .. })never lowered.v2.compiler.fold_loweringfold_call_step_formfound the step only by NAME (^f), so the positional spelling becameStepByName.foldstayed an ordinary call, and resolve refused it withresolve_reason_unbound_symbol. Real sites that use this spelling:dag/extdeps/container/oci/linux.dagcontains_namespace_typeand four calls indag/gunbc/instruments/rust_stage0_gates.dag.The step's position comes from the primitive's declared signature
collection_fold_shape. The two identicalfoldrows (free_monoid_collection and pointwise_power_collection) are now one template, likecollection_filter_shape. It gains theReceiverSelfslot that every sibling row (map,filter,any, ...) already carries, soparam_typesis the full free-call signature, receiver first.template_step_positionreads the first callable parameter's index off a template.fold_loweringfold_step_argument_positiontakes the position from that function. No literal index is written anywhere.v2.extdeps.languages.dagdag_call_positional_arg_value_optionalreads the direct argument at a position. It uses the same stop-at-every-arg rule as the named lookup, and a named argument at that position answers Absent.fold_call_step_formtries the name first, then the declared position. Both spellings reach the same step node and lower through the one seam. No second path was added.Parameter names. The row carries no parameter NAMES, so the names (
^f,^cons,^snoc,^algebra) stay authored per head infold_step_argument_name. That is stated at the site.Census of fold-family members
fold^fcollection_fold_shapefold_list,fold_list_right,fold_node^cons/^snoc/^algebraTheir signatures are ordinary v2 fn declarations with no data projection this stage can read, and no positional call site of any of them exists (§3c). A positional one stays the counted
FoldCallStepFormUnresolvedstate until those signatures become readable here.v1 consumers of the changed template, with behaviour unchanged
Adding
ReceiverSelfto thefoldrow is admitted underv1_seed_standingbecause it serves v2 and corrects the row. The v1 readers ofparam_typesare:v1.compiler.typesbuild_type_substitutionstrips a leadingReceiverSelf.v1.compiler.lookupdeclared_arg_types_for_methodstrips a leadingReceiverSelf.v1.compiler.typesinstantiate_algebra_fieldbuilds the same Self-first field shapemapalready has.v1.compiler.methodalgebra_param_templates:foldhas noderived_signatureregistry row, so nothing pairs names against it.callback_element_positionindexes inside the callable, so it is unchanged.The stage0 mirror
std_algebra.rswas regenerated with--required-regenand the candidate installed. On the rebuilt binary:dag/test/claim/primitive_signature_grounding_witness_test.dag: 11/11 pass.method_arg_declared_contract_witness_test: red. It is already enrolled expected-red (floor_expected_red, quarantined ingunbc.explicit_witness_admission), and its subject isget, notfold.cargo test --release -p v1-compiler --lib(local only, sincerust_unit_tests_off_the_merge_pathtakes it off CI): 10 failures on this head, all 10 also failing on the base commit (MQ-1: function values in value position (lambdas and fn literals) lower to the generic fn Arrow; unwritten types are fresh type parameters #12210's head, same host). The baseline run reported 950 passed / 30 failed. That count is inflated by the base worktree being removed mid-run, which can only add failures, never hide one. No test newly fails. None of the 10 reads the algebra fold template.Controls
v2.test.claim.fold_loweringpositional_fold_step_lowers_to_the_named_forms_loop: the positional form's lowered Loop has the samecontent_hashas the named form's.fold_call_step_formto name-only (Absent => StepByName) turns that claim red (FAIL), whilewell_formed_fold_still_lowers_through_the_splitstays green.positional_named_step_fold_is_step_form_unresolved:fold(xs, 0, step)stays unresolved. The positional reading does not widen into accepting whatever sits in the slot.The expected-red row does not retire (split ruled by gentle-koi-724)
wave1_gate1_b1_builtin_call_resolves_end_to_end_witness_holdsno longer hits the unbound-foldrefusal. Measured withgunbc runover a probe ofconserved_normalize_of_text→ resolve on the fixture:The two forms now fail identically, at the next boundary:
fold_call_seam_loopbuildsLoop(body, bound, carrier)and carries neither the collection norinit. The row (renamedfloor_expected_red_chunk_fold_seam_loop_drops_operands) restates that cause.Consumers of the Loop contract that the fix must migrate:
v2.std.nodeloop_behavior_edges_conform/loop_body_edges_conformclose the Loop's named edges to exactly^loop_bound_edgeand^loop_carrier_edge. New operand edges must be admitted there.v2.std.nodeloop_carrier_binder_targetv2.std.cardinalityloop_multiplicity, which reads the boundv2.lens.complexity_accumulator_copy.analyze, which reads the carrier offfold_call_to_loopand gates onfold_family_headv2.compiler.body_lowering_foldbody_lower_try_fold_loopFrontier, not this slice: option (b)
Resolve binding primitive callees from
std.primitive_identity. After this PR,foldin any spelling with an inline step no longer reaches resolve as a callee. Primitive callees that still reach resolve outsidefold_lowering:foldwith a step passed by name (fold(xs, 0, step))map,filter,flat_map,any,all,count,length,contains, ...), sincefold_loweringhandles only the fold familyBased on
session/fierce-gull-556(#12210), which owns the row and the shared step-literal decoder.🤖 Generated with Claude Code