Repository navigation
v2: typed cast node (Transform[coerce, e] + <cast-target>) retires the as-cast refusal - #12315
Conversation
…ted, instead of being dropped Step (0) of neat-boar-16's ordering for adhoc-bf64ffff-6d6. Measured on 748535d with a locally built gunbc: `fn f(x: Int) -> Int { let y: Q = x; y }` was ACCEPTED with Q declared nowhere -- Bind[binder, value, body] has no position for the annotation, so lowering dropped it before resolve. - body_lower_let_annotation_optional reads the annotation positionally (`let NAME : type_expr`); the statement-spine lowering refuses body_lowering_reason_type_annotation_not_carried at it. - New row gunbc.recurring_failure_mode body_type_annotation_dropped_before_resolve_in_v2. It also records the worse fn-literal route: `let g = fn(y) -> Q { y }` lowers to Bind[g, Atom(kw_fn), ..], the whole literal dropped by body_lower_bound_value's operand arm. That route is left to gunbc#12210, which rewrites exactly that lowering, and is named as its trigger. - Controls v2.test.claim.body_type_annotation_refusal: btar_let_annotation_refuses (red before), btar_unannotated_let_accepts (twin), specimens enrolled in floor_pure_producer_share. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…fused population and its restoration trigger (review 71023) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…atom operand fallback no longer answers a keyword token Side-chat REQUEST_CHANGES on 7d0262d (overrides the deferral to #12210: a deferred silent accept is what section 5 forbids). - body_lower_bound_value refuses a fn literal's return annotation (body_lowering_reason_type_annotation_not_carried) at the authored type expression before the operand arm sees the literal. Census: the grammar admits no other annotation on a function literal (fn-literal and arrow-lambda parameters are bare identifiers). - The eraser: body_lower_try_operand_or_reject's first-atom fallback returned Atom(dag_token_kw_fn) for a literal wherever it ran (let value, if arm). body_lower_atom_is_keyword_token declines a lexer keyword token there (true/false are read earlier as literals). Probed positions (let value, if arm, fn tail, match arm, record field, data initializer) all refuse loudly now. - Controls: btar_fn_literal_return_annotation_refuses (exact reason + locus is the authored Q), btar_unannotated_fn_literal_is_not_erased (disposition changes on purpose: it was Accepted only by erasure), btar_if_arm_fn_literal_is_not_erased; btar_let_annotation_refuses now asserts the locus, and anchoring it at the surrounding let reds it (mutation run locally). All 5 green locally. - RFM: fn-literal climb recorded; rung revision explicitly pending the floor run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…revised to rung 1 after the required floor passed on d2d840a Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rget> label rule (handoff to the let-annotation lane; unbuilt) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…annotation_not_carried reason Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ot_carried, located at T) instead of being dropped Census branch for neat-boar-16 (measure before choosing the carrier). Unrun locally. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ms reach the fold's refusal; if/match-arm controls Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…_carried; RFM row rung + typed-cast-node trigger; enroll producers Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e-applied as OperandRefRefused at Q on the new arm reader Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…left behind Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…pair Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e' into session/loyal-crab-333
…adable chain carrying a cast refuses
… on the rung with its capability trigger
…nts; Bind stays PositionalEdges until the let carrier lands its producer (review 71396)
|
Review 71396: agreed and fixed. The same push fixes the floor cost refusal. Four |
…o refusal (review 71406)
|
Review 71406: the finding stands and is fixed in ab4480a. The mechanism turned out to be different from the one proposed. Measured on the pilot route:
Changes:
The follow-up work item (refinement predicates in |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… producer Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s (the #12315 pattern) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… a Loop's own named edges pass the resolver gate (neat-boar-16)
|
Blocking finding from neat-boar-16 (side chat): confirmed and fixed in 6366e59. New controls in
|
…havior Named edges are validated at resolve (rung 3); trigger is a closed label coproduct in v2.std.node (review 71525 ruling)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… delta Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…RFM rows; partition 20/4 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contains #12308 (the as-cast refusal) and the
quick-dove-780-shared-marker-rulecommit (v2.std.nodePositionalPlusOneNamedEdges+ v2.std.type_binder<cast-target>). Until #12308 lands, the diff against main includes both.What
e as Tlowers to the typed cast node,Transform[coerce, e]plus the unauthorable<cast-target>edge toT. That node is carried through lowering, resolve, infer, translate and eval. This is the restoration trigger ofgunbc.recurring_failure_modeas_cast_has_no_lowered_form, and it retires #12308's refusal.v2.compiler.body_lowering_fold):PostfixCast), soa.b as T,(x as T).f,x as A as Bandg(v: x) as Tfold as one chain.body_lower_cast_nodebuilds the node.g(v: x) as Intwas accepted with no cast node.type_annotation_not_carriedat that type.v2.compiler.resolve). This PR builds the type-role frame, per the parent ruling, and lively-newt-275 rebases their let-annotation carrier onto it.ResolveContextgainstype_scope, which carries a fn's<T>over the whole Arrow and never a value binder.resolve_type_role_targetis the one type-role entry. An undeclaredTrefuses unbound atT.Tin a value position now refusesresolve_reason_type_parameter_in_value_positioninstead ofunbound_symbol, as neat-boar-16 ruled. The no-shadowing refusal is kept, and an Arrow's own binders are checked from the outer context.v2.compiler.inferinfer_transform_cast_optional):v2.std.coercioncoercion_cast_crossingfinds an exact structural witness from the operand's derived type toT. That is coercion's own procedure over the singleton{T}withUniqueOnly.std.coerciondag_cast_rulesis not consulted (coercion_two_algebras_answer_one_question_stall; its join is untouched).v2.std.compilers.target_model):CanonicalOperationvariantCoercionCrossing { homomorphism_rule }, grounded byv2.std.coercion's rule symbol. It is a Symbol because coercion imports target_model. The wire, equality, decode and roster sites are all updated.kw_asto it.TargetOperatorShapevariantOperandUnchanged: how v1'semit_typed_cast_sharedspells a representation-preserving crossing, not Rustas. Rust and TypeScript each get a realization row.application_positional_targets(the cast target is passed over; any other named edge still refuses),body_lower_reify_transform_edge, and the complexity lens's port and combiner readers.eval_edge_is_runtime_argumentadmits only positional edges.Census (brief item 5)
Instrument:
v2.compiler.reference_conservation_censusreference_conservation_census_for_paths, which measures through resolve. Each arm ran from its own worktree, batched 8 paths per process, with the same interpreter binary. Batches whose process died were re-run until every readable path was measured.The 68 of #12308, before
620ecb0a50fvs this branch atac97ef3711a:refused=0. Conserved went up on 58 and was equal on 9, with no decreases. Cast targets now reach the collector.dag/extdeps/uri.dagrefuses at this head, but not because of this change. It refusesbody_lowering_reason_call_argument_unreadat the lambdacp => uri_percent_encode_scalar_outcome(cp: cp). Current main (a1d5db9518a) refuses that lambda identically, with or without a cast in the body; I checked the same shape on the pilot route on both trees. That islambda_has_no_lowered_function_value_form, which landed on main after620ecb0a50f: base drift, not a regression here.docker/hub.dagandtools/id.daghaveconserved=0in both arms, so v2 body lowering: an as-cast's target type refuses (type_annotation_not_carried, at T) instead of being dropped #12308's "each had conserved>0" was imprecise for those two."Nothing new may refuse": the 315
reference_conservation_stratified_sample_paths, maina1d5db9518avs this branch atdfeb1228274(which contains that main):dag/gunbc/host/host_resource.dag,dag/test/claim/data_reference_kind_from_resolved_node_witness_test.dag,dag/test/claim/extdeps/apt_package_of_witness_test.dag.unmeasuredvalue changed.dag/gunbc/namespace/transition_admission/*files that no longer exist in either tree.Controls
v2.test.claim.body_cast_nodereplacesbody_cast_target_refusaland has 17 claims, all green locally:Tis carried on tail, let value, call argument, if arm, match arm and call operand.Qrefuses atQ.Tbinds<T>, and a value binder never answers for a type.transform_shape_invalid).1 as Posrefuses at infer with coercion'sNoTargetCandidate, located at the operand, andx as IntfromPosis admitted.an_as_cast_operand_resolvesflips the cav row.Residue, stated
A cast into a refinement (
"lit" as NonEmptyStr, whereNonEmptyStr = String where non_empty) is not structural equality, so it refuses at infer wherever the operand's type is derived. This was measured on a fixturetype Pos = Int where positive:1 as Posrefuses andx as IntfromPosis admitted. No route runs infer over the census modules today, so the census verdict is unaffected, but the 44 data-row modules would re-refuse at infer. So the census measures those 44 modules through resolve only; they are not Accepted end to end. The rung is stated onas_cast_has_no_lowered_form. Its next-rung trigger names the capability:v2.std.coerciondeciding a refinement's predicate on the cast operand, literal first. That follow-up is filed as work itemnode://adhoc-032c89dc-138. Note: this PR had already left draft when the parent's conditions arrived, so the item was filed after the flip, not before.🤖 Generated with Claude Code