Repository navigation
M0: //gunbc/instruments:type-declaration-use-census — resolved type-declaration and cast census (nominal-type plan) - #13093
Conversation
…uments:v2-native-census The census and census-resolve verbs of the emitted v2 compiler now group every front-end file refusal and resolve residual row under its FATAL reason (v2.std.diagnostic diagnostics_fatal). The head reason stays on each member as a field and is never used as the grouping key. The grouping fold is v2.compiler.compile native_census_cause_groups_*. The emitted main only prints the groups, plus a partition verdict that the instrument reads. The census is reached through ONE instrument row, //gunbc/instruments:v2-native-census (gunbc.instrument_targets, V2NativeCensusProducer). The verbs remain only as that row's realization. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…census output Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ensus is a report (review 74324) The partition check (members summed over groups == rows reported) counted rows through the same calls that grouped them, so its red was not authorable in a real run -- a DESIGN 4b decoration. Removed from the fold, the emitted driver, the host and the claims; the instrument now reports held on a completed census and unreached otherwise, with no did-not-hold arm, and says so on gunbc.instrument_targets v2_native_census_label. The emit_rust mirror is regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nstructor) on NormalizedTree The slot was consumed by G0 and minted nothing, so no reader of a lowered declaration could tell `type X nominal_opaque = Y` from `type X = Y`. Precursor to M0 of the nominal-type plan (gunbc#13024): the census's Opaque class is unobservable without it. - v2.compiler.body_lowering_fold: closed vocabulary TypeDeclModifier and a positional reader of the slot off the parse (body_lower_type_decl_declared_modifiers); an unreadable slot refuses, located, never read as empty. - v2.compiler.normalize: type_declaration_modifier_capture, carried on NormalizedTree type_declaration_modifiers beside type_declaration_kinds; admit_normalized_tree takes it. - Control: v2.test.parse.type_decl_modifier_carrier (carries / does not / slot order / spelling as a name / real normalize route). Unknown spellings stay refused at parse by the existing probe. - gunbc.rung_drop g0_type_decl_modifier_parse_without_sealing_property narrowed, not retired: carrying enforces nothing, and its trigger is the construction wall. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…loor NonFoldResidueRosterDiverged) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…new-witness step budget (84854 > 72300 with an alias rhs) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ppearance order (review 74382) native_census_cause_group_rows snoc'd each group onto a cons accumulator over a reversed order list, which is an O(g^2) fold that DESIGN section 6 fixes regardless of n. `order` is already newest-first, so consing while walking it yields first-appearance order in one pass, with no snoc and no reverse. The supplied-rows claim now asserts that the first group is the one first seen. Under a mutation that inverts the fold's order it returns false; with the fix it returns true. v1 PURPOSE receipt (gunbc.v1_maintenance_standing): the host Rust this PR adds is run_v2_native_census (native_lane_runner) plus one TargetProducer arm (target_invocation_host). It is the documented "a row in instrument_registry and an arm here" extension. It serves the v2 self-host program by running the emitted v2 compiler's own census verb, decides no census semantics (grouping is the .dag fold), and deletes no scaffold because none exists. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nkeyed lexical refs in a hand-built fixture), first selected by this PR's call-site edit Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… minted occurrences (resolve keys lexical bindings by occurrence) Drops the floor_expected_red row added in 588c329 (which also broke that file's parse). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ledger-Repair-Judged: docs/design-rung-drops.md Ledger-Rows-Repaired: docs/design-rung-drops.md g0_type_decl_modifier_parse_without_sealing_property Ledger-Rows-Repaired: docs/design-rung-drops.md edited_bin_witness_wet_rows_not_executed_by_ci Heal-Candidate-Run: 37090292139
# Conflicts: # src/v1/stage0/src/v1_compiler_emit_rust.rs
…ssion/tidy-koi-264
…ia emit_produced module_member_class, base, where-predicate refs, modifiers) infer: refinement_declaration_of_node split out so the census reads refinements through infer's one reader. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…odule step (NativeInferCensusOutcome) Casts read off the inferred tree: target resolved, operand typed by infer's own reader (infer_branch_operand_resolved_type_in_tree), immediate-parent evidence. Receipt joins across modules: declaration classes (UNCONSUMED first), cast classes with Exception and OperandTypeUndecided as typed classes, affected-module list (gate decided host-side). Unreached module => no observation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…r); type-census dispatch moved into the walk (no compile->census->compile cycle) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…veCensusProducer { reading }), host arm, reader with fixture + unindexed controls and the out-of-gate filter, receipt-interface claims
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…er (remote regen, fixed point: second --required-regen reported no drift) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…bel (whole-tree run exceeds the BuildBuddy hour) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d-file advisories (main); mirror to be regenerated
…ed point: second --required-regen no drift) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
On the hand-written seed Rust advisory (review 74687, and 74636 before it): the receipt is in the PR body under Hand-written seed Rust receipt. It is a deferral that names its lane: — sent from tidy-koi-264 |
…n_wet): type-declaration-use-census option Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d_resource_names (review 74730), not a hand-rolled predicate over DeclaredTypeKind Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…spatch label): keep V2NativeCensusProducer { reading }, union the dispatch labels; generated files to be regenerated
…in (fixed point: second --required-regen no drift) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…(floor: unresolved import) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
M0 whole-tree receipt. The run is instrument-dispatch 37119024146 at 163bb59, label Controls held. The fixture root matched its expected rows by identity in both directions, and the unindexed root refused with status 2. The whole tree's verdict is no observation (exit 2), as designed, because modules are unreached. Coverage: too low to size M2. I am not shipping the sizing.
Declaration totals, over the 1329 resolved modules only. These are a lower bound by construction:
Most refinements sit in modules that do not resolve, which is why the last two rows are so small. The affected and out-of-gate lists each have 334 entries. Typecase-shaped sites (would reopen D3): none observable, because no cast was decided. §2 table findings:
What would make the census size M2: native resolve for the unbound and ambiguous population, plus native infer admitting a cast into an alias or refinement (the |
… and demand-census everywhere (verb, plan, usage, template loop, dispatch labels); generated files to be regenerated
…-census merge (fixed point: second --required-regen no drift) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ptation) #13093 added three native_test_context_absorb callers on main with the pre-locus arity. Tokenize or parse refusal: span_index_empty() (those loci are Textual already); normalize refusal and accepted: artifact.span_index, this file's own. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…quired-regen no drift) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…declaration-use-census; workflow regenerated next
…dispatch-label merge Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s follow-up does not own)
M0 of the nominal-type plan (gunbc#13024,
docs/plans/nominal-type-declaration-plan.md§2). Stacked on #13026 (deep-badger-684's native census row), which should land first. The precursor #13033 has already landed.Status: lands as an instrument, with NO M2 sizing (operator ruling 2026-10-03). The nominal migration is parked until native resolve and infer coverage grow. Re-running this instrument is how that is decided.
The receipt: coverage verdict
//gunbc/instruments:type-declaration-use-census, revision 163bb59. The receipt lines are in that run's job log, because the artifact'sstdout.txtcame back empty; that capture defect is filed as work itemadhoc-82107088-798.resolve_reason_unbound_symbol, thenresolve_reason_ambiguous_symbol. This is the namespace-cut and native-resolve frontier.construct_tag_not_a_constructor, anonymous-record typing, binder hiding, realized-declaration mismatch, an unbound where predicate, and an unlowered float literal.OperandTypeUndecided, and none is decided. In each case the module did not infer. That is the N7 native-infer frontier, led byfind_witness_reason_no_candidate(a cast into an alias or refinement) andinfer_grounding_not_derived. A module refuses infer on its first fatal, so one undecidable cast undecides all of its casts.nominal_opaque; one-field records; Opaque's second disjunct; encoding pending S2. These are recorded as open items in the plan's Parked note (PLAN: one nominal type-declaration model; delete refinements #13024 head 1666a95), not as code.What it is
gunbc test //gunbc/instruments:type-declaration-use-censusis one more row in the native census family.V2NativeCensusProducernow carries areading(ResolveRefusalReadingfor the existing row,TypeDeclarationUseReadingfor this one), so it is not a second registration pattern (sharp-raven-357's ruling).census-infer. A new native-driver verb that resolves and then infers every ingested module. Its per-module step,v2.compiler.compile native_census_module_inference, is the same infer the native lane demands (native_test_infer_resolved). It is shared with census part 2: quiet-boar-260's Design: census part 2 — inference/emit census below resolve #13019 §2a reads the refused arm. One infer walk, not two.census-resolvekeeps its cost and meaning.gunbc.instruments.type_declaration_use_census) read the resolved and inferred trees, never text:v2.compiler.emit_produced module_member_class). Refinement carrier and predicates are read throughv2.compiler.infer refinement_declaration_of_node, split out fromrefinement_declarationso the census has no second reader. Modifiers come from v2: carry the type-declaration modifier slot on NormalizedTree (M0 precursor) #13033's carrier.assites: the target is the declaration the cast resolves to. The operand's type comes from infer's own reader (infer_branch_operand_resolved_type_in_tree). The immediate parent supplies the evidence: compare, order, add, a call (by callee path plus the declared parameter type), or the fn's declared return.{module, symbol | enclosing@occurrence, form, class, witness, evidence}.NominalProjection(ruling from the plan's author).affected <module>. The host reader (gunbc.instruments.type_declaration_use_census_reading) filters those throughv2.workflow.required_floor required_gate_admitsintoout_of_gatelines for M2's PR body. The gate is read host-side, so the emitted compiler's closure does not carry a workflow roster.Controls
test.claim.type_declaration_use_census_witness_test, 18 claims, all PASS remotely at 9fee458). The rows are supplied: one declaration and one cast of each class, the mutation control (introduction rewritten as projection changes class), and an unindexed module refusing with no observation.NominalProjectionturned exactlya_strip_with_no_parent_evidence_is_an_exception_not_a_projection_holdsred. Dropping the UNCONSUMED check turned exactlyan_unreferenced_declaration_is_unconsumed_not_alias_holdsred.type_census_fixture_files): an identity join in both directions against the expected rows.native_driver_plan_testhas a new claim thatcensus-inferplans as its own word, and its pinned usage strings are updated.v1_compiler_emit_rust.rswas regenerated remotely. The second--required-regenreported no drift.Findings and departures, stated rather than hidden
n as Port) makes native infer refuse its whole module (find_witness_reason_no_candidate, the N7 frontier). Those modules' casts come backOperandTypeUndecided, soNominalIntroductioncoverage is low until native infer admits the crossing. The real-route fixture pins that cast as undecided, so it goes red when infer improves. Whether coverage is enough to size M2 is reported with the receipt, not assumed.nominal_opaque(type MachineWidth<bits>) isBodylessUnclassified.resourcedeclaration isResourceUnclassified.UnconstrainedNominal(a public raw constructor over its field).The table may want rows for these. Reported, not invented into the plan.
nominal_opaquedecides Opaque. Computing the rest needs view-read evidence.OperationWorkaround:encodebecause encoding has no capability home yet (§9 S2). An encode-shaped call lands in the exception list, with the callee named in its evidence.NominalProjectionevidence yet. Only call parameters and fn returns do, so those sites are exceptions.src/v1/05_emit_rust.dag), besidecensusandcensus-resolve, following their precedent. Every decision in it is a.dagfold. It is admitted under the v1 purpose test as v2-instrument plumbing.Hand-written seed Rust receipt
target_invocation_hostrun_type_declaration_use_censusandfixture_file_rows.cli_run::native_lane_runnerrun_census_infer_withandrun_type_declaration_use_census_runs, plus theV2NativeCensus { reading }field.run_v2_native_censusis census A: native census refusals grouped by fatal reason; //gunbc/instruments:v2-native-census #13026's, carried in by the stack, and is not added here.gunbc test //gunbc/instruments:type-declaration-use-census. This is the instrument seam DESIGN "Building & checks" prescribes ("a row ininstrument_registryand an arm here"). Every decision it makes is a.dagfold:type_declaration_use_census_standing, the fixture rows, and the receipt ingunbc.instruments.type_declaration_use_census. The host writes files, spawns the binary and passes values.gunbc.v1_maintenance_standingv1_seed_standingpurpose test. The Rust is v2-instrument plumbing (the census measures v2's own resolved and inferred trees). No seed semantics change.🤖 Generated with Claude Code