Repository navigation
XL-2 LoweringOccurrenceProjection 1/3: constructor tag atoms lowered from the tag token - #12305
Conversation
…red from the tag token construct_tag_edge built a record-literal tag / pattern constructor atom with the enclosing capture's occurrence. It now takes the tag's own terminal and uses node_lowered_from, so the tag keeps its minted occurrence. Adds a controlled-fixture claim: 9 conserved before, 11 after (the two tags). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…1-tag-sources # Conflicts: # src/v2/test/claim/namespace_xl0/reference_conservation_test.dag
briansrls
left a comment
There was a problem hiding this comment.
APPROVE at exact head f8ebce0, for merge-queue landing.
This is the bounded constructor-tag repair in #12302, not a new provenance mechanism. construct_tag_edge now receives the tag's own authored Node; construct_node still receives the enclosing source separately, so the Conj keeps its occurrence while the tag atom retains its terminal occurrence. Both production call sites preserve the source node they already possessed: record literals return RecordLiteralTag {tag, at}, and pattern suffixes retain body_lower_pattern_leaf_atom_optional instead of discarding that node through the deleted symbol-only helper. Tag spelling and construct shape are unchanged.
The controlled-fixture witness discriminates exactly two tags: authored 22, conserved 11, locus_erased 11, dropped 0 versus the reported base's conserved 9 / erased 13. Its warm registration is included. This is a fixture membership/provenance repair, not an assertion that the live corpus is fully conserved. Qualified-spine projection and the remaining rollout remain outstanding.
I reviewed the complete patch and the red/green receipt, and inspected exact-head Actions run 36203797924: all five jobs succeeded. I did not rerun the claims locally; the body correctly qualifies the separate older-main comparison for the other three claims.
Require the actual merge_group candidate to pass against then-current main. #12314, #12317 and #12334 are NOT covered by this approval: after each predecessor lands, retarget the next to main and obtain its own exact-head review and green checks. No direct merge or bypasses.
XL-2
LoweringOccurrenceProjection, PR 1 of 3: constructor tags keep their own occurrenceThis is PR 1 of the rollout in #12302 (design). It is the rank-3 site there.
Defect.
v2.std.node_queryconstruct_tag_edgebuilt the tag atom of a construct using the enclosing captured shell's occurrence. That covers both a record literal (RcRow { v: n }) and a constructor pattern (RcRow { v: x } =>). So the tag atom carried a real but wrong locus: the whole literal instead of the tag token. The conservation census counted every such tag aslocus_erased.Fix (the design's one mechanism).
construct_tag_edgeandconstruct_nodenow taketag_source: Node, and the tag atom is built withnode_lowered_from(source: tag_source). The construct'sConjkeeps the construct's own occurrence. Both callers already held the tag's own atom node:body_lower_record_literal_tag_optionalnow returnsRecordLiteralTag { tag, at }, whereatis thepair.leftit had already read the tag from.body_lower_pattern_suffix_lowerednow usesbody_lower_pattern_leaf_atom_optionaldirectly. The symbol-onlybody_lower_pattern_head_symbol_optionallost its last caller and is deleted.No shape change: the same
Conj, the same labels, the same atom identities. Only the tag atom's occurrence changes. No generated Rust mirrors these functions.Evidence (local, seed-run interpreter).
constructor_tags_keep_their_own_occurrence_holdsruns on a controlled fixture:authored == 22 && conserved == 11 && locus_erased == 11 && dropped == 0.false(the fixture measures conserved=9, locus_erased=13 there).true. Exactly the two tags moved.v2.workflow.floor_pure_producer_share, next to the module's other fixture subjects.v2.test.claim.namespace_xl0.reference_conservationwere run on head, with the same results as on a base without this change. Three returnfalseboth with and without it:the_if_arm_call_argument_is_reported_dropped_holds,a_list_literal_call_argument_refuses_its_whole_module_holds,a_repeated_spelling_with_one_copy_dropped_is_exactly_one_row_holds. Caveat: that base was main69e0bb7566e, not this branch's merge base8bf4b66774c. CI's floor is the authority for those three.Coordination. bright-boar-848 owns
body_lowering_foldand confirmed no overlap with these functions.🤖 Generated with Claude Code