Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
aca776f
v2: coercion admits a refinement-to-declared-carrier cast as Widened
Sep 27, 2026
946ee79
Merge origin/main
Sep 27, 2026
415fdb7
infer: RefinementDeclaration drops unconsumed path; where_clause name…
Sep 27, 2026
59e14d6
body_cast_node: 15b/15c supply values at coercion's interface; drop t…
Sep 27, 2026
21b8895
Merge remote-tracking branch 'origin/main' into session/wise-bat-862
Sep 27, 2026
03342a3
v2 resolve: ResolvedTree carries the SymbolIndex resolution consulted…
Sep 27, 2026
179c7f1
Merge origin/main; migrate the remaining resolved-tree helpers (typec…
Sep 27, 2026
5fa0197
infer: refinement_declaration reads resolve's SymbolIndex (gunbc#1243…
Sep 27, 2026
95856ef
pick_ingested: the arrow extractor returns the arrow Node (my retype …
Sep 27, 2026
1c0fe0d
infer: drop the unused tree parameter from infer_bind_annotation_chec…
Sep 27, 2026
84d4768
Merge origin/main; retype main's new resolved-tree helpers (declared_…
Sep 27, 2026
3c32c9a
Merge the carrier branch (#12432) into #12407
Sep 27, 2026
f88aa3a
infer: thread symbol_index through the gather step call the carrier m…
Sep 27, 2026
86ac631
infer: drop the unused tree parameter from infer_transform_cast_optio…
Sep 27, 2026
6d32120
infer: thread ResolvedTree whole as 'resolved'; parameter scope searc…
Sep 28, 2026
c12bf6d
Merge origin/main into the carrier (kinds stays a separate once-prepa…
Sep 28, 2026
5a81c79
Merge the carrier branch (#12432): kinds stays a separate input besid…
Sep 28, 2026
341a092
Merge origin/main (#12379 landed)
Sep 28, 2026
0fb011f
Merge origin/main (#12379 landed); #12379's new hand-built infer inpu…
Sep 28, 2026
90b0cf2
Merge the carrier branch (main with #12379): arrow elimination keeps …
Sep 28, 2026
23697f7
Merge origin/main (declared_signature moved to v2.std.arrow_signature…
Sep 29, 2026
66c401b
Merge origin/main (#12440 landed)
Sep 29, 2026
ec7c3de
Merge origin/main (5 commits); one_member_cost_probe keeps main's wan…
Sep 29, 2026
cd88b7d
Merge origin/main
Sep 29, 2026
2b8dc42
plain_type_decl_lowering (new from main): its assembly helpers carry …
Sep 29, 2026
3f95faa
Merge origin/main
Sep 29, 2026
c90dae3
Merge origin/main; body_let_annotation (#12540's new rows) carries Re…
Sep 29, 2026
029efaf
v2: lower the where-refined head as a type so resolve binds it; Resol…
Sep 29, 2026
9d653a0
Merge origin/main (#12432 landed as a squash)
Sep 29, 2026
3c18481
Merge #12629 (resolved declarations); refinement_declaration reads re…
Sep 29, 2026
f293dcb
resolve: ResolvedTree comment states symbol_index's consumers once (n…
Sep 29, 2026
89074cb
Merge #12629 (comment fix)
Sep 29, 2026
2e0c19e
body_cast_node: the Pos2 one-step row reads the resolved carrier only…
Sep 29, 2026
9ce7fd5
Merge origin/main (#12629 landed as a squash)
Sep 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ data as_cast_has_no_lowered_form: RecurringFailureMode = RecurringFailureMode {
"RUNG FOUND AT: mitigated on the operator route; below the floor on the value route (the cast's type was dropped, so `x as Q` was Accepted with `Q` declared nowhere). CEILING: structurally guaranteed -- a cast lowers to a value carrying its operand and its target type, or refuses.",
"RUNG NOW: mitigated on EVERY route. `v2.compiler.body_lowering_fold` `body_lower_postfix_expr` refuses a postfix chain carrying an as-suffix with `body_lowering_reason_type_annotation_not_carried` located at the authored target type -- the one reason for a type the lowering cannot carry, shared with the let annotation -- and `body_lower_arm_operand_resolved_optional` declines a cast so a let value or an arm reaches that refusal instead of answering the operand. A declared target refuses too: nothing is carried, so nothing is accepted. As an operator operand the cast now refuses with the same reason, because the postfix is folded before the operator reader sees it. CENSUS: the v2-route identity census over the 321-path population (`v2.compiler.reference_conservation_census` `reference_conservation_stratified_sample_paths` plus six) re-derived by `reference_conservation_census_for_paths` over each arm (pair 620ecb0a50f / 4c9f8d326d3): the modules that newly refuse are data rows casting a literal to a refinement and fn bodies casting to String, each refusing whole, and each returns when the trigger below lands.",
"NEXT-RUNG TRIGGER, NAMING THE CAPABILITY (the one the refusal above was retired by): a TYPED CAST NODE -- `e as T` lowers to Transform[coerce, e] with `v2.std.type_binder` `<cast-target>` -> T beside its positional children, and that node is SUFFICIENT FOR: resolve binding T in type role through the shared type-role frame (an undeclared T refusing at T); infer admitting the crossing through `v2.std.coercion` (not `std.coercion` `dag_cast_rules`, which is v1's side of `coercion_two_algebras_answer_one_question_stall`) or refusing typed; and translate and eval realizing it or refusing typed -- on every route, for every cast the refusal now stops.",
"RUNG NOW, AFTER THE TRIGGER: structurally guaranteed on the lowering and resolve routes -- the postfix chain read carries a cast as a step (`v2.compiler.body_lowering_fold` `PostfixCast`) and the chain fold builds `body_lower_cast_node`, so no reader answers `x as T` with `x`; a target type the lowering cannot read refuses `body_lowering_reason_type_annotation_not_carried` at it; `v2.compiler.resolve` `resolve_type_role_target` binds T in the type-role frame (`ResolveContext` `type_scope`, which carries a fn's <T> over its whole Arrow and never a value binder) and an undeclared T refuses unbound at T. Infer (`v2.compiler.infer` `infer_transform_cast_optional`) admits a crossing only when `v2.std.coercion` `coercion_cast_crossing` finds an exact structural witness from the operand's derived type to T, and refuses with coercion's typed mismatch otherwise; an operand whose type is not derived leaves the cast on the counted frontier. Translate projects the cast as a one-operand primitive apply of the coercion `CanonicalOperation` (`CoercionCrossing`) and the rust and typescript extdeps realize it `OperandUnchanged`, as v1's emitter spells a representation-preserving crossing; the v2 evaluator realizes it as the operand's value. RESIDUE, STATED ON THE RUNG: a cast INTO a refinement (`lit as NonEmptyStr` for a string literal `lit`, `NonEmptyStr = String where non_empty`) is not an exact structural crossing, so on the infer path it REFUSES, loud and typed (coercion's NoTargetCandidate, located at the operand), wherever the operand's type is derived . The identity cast `x as Pos` from `x: Pos` is ADMITTED: infer binds a parameter by its enclosing Arrow (`v2.compiler.infer` `infer_parameter_type_in_scope`), so x grounds as the Pos declaration-reference and the crossing is exact. A cast from a refinement-typed value to its carrier (`x as Int` from `x: Pos`) REFUSES, loud and typed at the operand, until `v2.std.coercion` admits a refinement-to-declared-carrier crossing as Widened from the type declaration (its existing widening fold needs per-domain integer value sets); it previously admitted only because an unscoped parameter walk bound x to an unrelated `fn positive(x: Int)`. The 44 data-row census modules casting a literal into `NonEmptyStr` are therefore measured Accepted through RESOLVE ONLY (the census instrument's reach), not end to end. NEXT-RUNG TRIGGER FOR THAT PATH, NAMING THE CAPABILITY: v2.std.coercion deciding a refinement's predicate on the cast operand (a literal first), so a crossing into a refinement is admitted exactly when the predicate holds and refused located when it does not.",
"RUNG NOW, AFTER THE TRIGGER: structurally guaranteed on the lowering and resolve routes -- the postfix chain read carries a cast as a step (`v2.compiler.body_lowering_fold` `PostfixCast`) and the chain fold builds `body_lower_cast_node`, so no reader answers `x as T` with `x`; a target type the lowering cannot read refuses `body_lowering_reason_type_annotation_not_carried` at it; `v2.compiler.resolve` `resolve_type_role_target` binds T in the type-role frame (`ResolveContext` `type_scope`, which carries a fn's <T> over its whole Arrow and never a value binder) and an undeclared T refuses unbound at T. Infer (`v2.compiler.infer` `infer_transform_cast_optional`) admits a crossing only when `v2.std.coercion` `coercion_cast_crossing` finds an exact structural witness from the operand's derived type to T, and refuses with coercion's typed mismatch otherwise; an operand whose type is not derived leaves the cast on the counted frontier. Translate projects the cast as a one-operand primitive apply of the coercion `CanonicalOperation` (`CoercionCrossing`) and the rust and typescript extdeps realize it `OperandUnchanged`, as v1's emitter spells a representation-preserving crossing; the v2 evaluator realizes it as the operand's value. RESIDUE, STATED ON THE RUNG: a cast INTO a refinement (`lit as NonEmptyStr` for a string literal `lit`, `NonEmptyStr = String where non_empty`) is not an exact structural crossing, so on the infer path it REFUSES, loud and typed (coercion's NoTargetCandidate, located at the operand), wherever the operand's type is derived . The identity cast `x as Pos` from `x: Pos` is ADMITTED: infer binds a parameter by its enclosing Arrow (`v2.compiler.infer` `infer_parameter_type_in_scope`), so x grounds as the Pos declaration-reference and the crossing is exact. A cast from a refinement-typed value to its DECLARED carrier (`x as Int` from `x: Pos`, `type Pos = Int where positive`) is ADMITTED as Widened: `v2.compiler.infer` `refinement_declaration` reads the carrier from the declaration the reference's path reaches, and `v2.std.coercion` `coercion_cast_crossing` composes that carrier edge with the same exact-structural find_witness -- no preservation rule is added and no predicate is evaluated. Only the DECLARED carrier widens, one step: `x as Bool` from x: Pos and `x as Neg` between two refinements of Int REFUSE at the operand; for a refinement of a refinement (`type Pos2 = Pos where ..`) `x as Pos` is Widened and `x as Int` REFUSES (the carrier edge is not walked). The declaration is read through `v2.std.symbol_index` `symbol_index_lookup` on `v2.compiler.resolve` `ResolvedTree` `resolved_declarations` (gunbc#12629: declarations with resolved bodies, so a carrier is the identity resolve bound), and a lookup miss refuses (`bcn_a_refinement_lookup_miss_refuses`). Residue on that arm: the lowered cast's operator names `CoercionCrossing` by the exact rule (`v2.std.compilers.target_model` `canonical_operation_op_coerce`), fixed at lowering, so a Widened crossing is realized under that identity; both are representation-preserving (`OperandUnchanged`), so no emitted program differs. The 44 data-row census modules casting a literal into `NonEmptyStr` are therefore measured Accepted through RESOLVE ONLY (the census instrument's reach), not end to end. NEXT-RUNG TRIGGER FOR THAT PATH, NAMING THE CAPABILITY: v2.std.coercion deciding a refinement's predicate on the cast operand (a literal first), so a crossing into a refinement is admitted exactly when the predicate holds and refused located when it does not.",
],

evidence: [
Expand All @@ -36,7 +36,11 @@ data as_cast_has_no_lowered_form: RecurringFailureMode = RecurringFailureMode {
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_a_loop_passes_the_resolver_gate", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_a_foreign_label_on_a_transform_refuses", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_cast_into_a_refinement_refuses_at_infer", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_cast_out_of_a_refinement_refuses_until_carrier_widening", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_cast_out_of_a_refinement_to_its_declared_carrier_widens", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_cast_out_of_a_refinement_to_a_non_carrier_refuses", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_cast_between_sibling_refinements_refuses", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_a_refinement_lookup_miss_refuses", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_refinement_of_a_refinement_widens_one_step", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.body_cast_node", decl_name: "bcn_identity_cast_into_a_refinement_admits", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.namespace_xl0.call_argument_value_resolve_refusal", decl_name: "an_as_cast_operand_resolves", field: WholeDeclaration },
DeclarationRef { module_path: "v2.test.claim.namespace_xl0.call_argument_value_resolve_refusal", decl_name: "a_parenthesised_call_operand_resolves", field: WholeDeclaration },
Expand Down
Loading
Loading