From 9595f5339f962488d6e581bd590b1c437b3114d1 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 2 Oct 2026 21:50:36 +0000 Subject: [PATCH 01/24] census A: group native census refusals by fatal reason; //gunbc/instruments: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) --- dag/gunbc/instrument_targets.dag | 21 ++- dag/gunbc/target_binding.dag | 1 + src/v1/05_emit_rust.dag | 26 +++- src/v1/stage0/src/cli_run.rs | 5 +- .../stage0/src/cli_run/native_lane_runner.rs | 80 +++++++++++ src/v1/stage0/src/target_invocation_host.rs | 30 +++++ src/v2/compiler/00_compile.dag | 127 ++++++++++++++++++ .../whole_tree_census_resolve_test.dag | 66 +++++++++ 8 files changed, 351 insertions(+), 5 deletions(-) diff --git a/dag/gunbc/instrument_targets.dag b/dag/gunbc/instrument_targets.dag index ba7c39694f9..7e8dc3e2b70 100644 --- a/dag/gunbc/instrument_targets.dag +++ b/dag/gunbc/instrument_targets.dag @@ -241,6 +241,19 @@ fn v2_native_frontier_label() -> Label { Label { package: instruments_package() target: TargetName { name: "v2-native-frontier" } } } +// THE NATIVE CENSUS INSTRUMENT: the emitted compiler's `census-resolve` verb over the self-host +// corpus, every front-end and resolve refusal GROUPED BY THE FATAL REASON +// (v2.compiler.compile native_census_cause_groups_add) with the head kept as a member field. It is +// THE route to that census: the binary's `census` / `census-resolve` verbs remain only as this row's +// realization and are not a second documented peer route, which is the --self-host precedent this +// file states for `//gunbc/instruments:self-host` (DESIGN section 3, Building & checks). The +// observation holds when the emitted fold reports that the groups partition every reported row; +// a broken partition is an observation that did not hold, and a run that printed no terminal is +// the subject unreached. +fn v2_native_census_label() -> Label { + Label { package: instruments_package() target: TargetName { name: "v2-native-census" } } +} + // THE EMITTED CLOSURE AS A MULTI-CRATE WORKSPACE (Pkg7e). The seed emits `v2.compiler.compile`'s // closure, `v2.workflow.emitted_crate_workspace` `emitted_workspace_plan` partitions it into crate // rows from the derived module DAG, the emission's returned edges and the transitive unit @@ -470,6 +483,10 @@ fn dag_emit_real_grammar_round_trips_binding() -> TargetBinding { TargetBinding { target: dag_emit_real_grammar_round_trips_label() producer: NativeClaimProgramProducer { entry: dag_emit_real_grammar_round_trips_entry() } } } +fn v2_native_census_binding() -> TargetBinding { + TargetBinding { target: v2_native_census_label() producer: V2NativeCensusProducer {} } +} + fn v2_native_frontier_binding() -> TargetBinding { TargetBinding { target: v2_native_frontier_label() producer: V2NativeFrontierProducer {} } } @@ -610,7 +627,7 @@ fn instrument_targets() -> List