Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
98 changes: 47 additions & 51 deletions src/v3/compiler/src/bootstrap_generated.rs

Large diffs are not rendered by default.

98 changes: 47 additions & 51 deletions src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/v3/compiler/src/dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2362,7 +2362,7 @@ pub struct Dag {

static BOOTSTRAPPED_DAG: LazyLock<Dag> = LazyLock::new(|| {
let mut dag = bootstrap_generated::bootstrapped_fixture_dag();
assert_extdeps_bootstrap_fixture_paths_match_regen_keys(&dag);
assert_bootstrap_fixture_paths_match_regen_keys(&dag);
dag.populate_primitive_cache();
crate::int_literal_ranges::validate_rust_pilot_integer_primitives(&mut dag);
dag
Expand All @@ -2380,7 +2380,7 @@ static BOOTSTRAPPED_STD_FIXTURE_DAG: LazyLock<Dag> = LazyLock::new(|| {
static BOOTSTRAPPED_DAG_WITHOUT_PARSE_SURFACE_FIXTURE: LazyLock<Dag> = LazyLock::new(|| {
let mut dag =
bootstrap_generated_without_parse_surface::bootstrapped_fixture_without_parse_surface_dag();
assert_extdeps_bootstrap_fixture_paths_match_regen_keys(&dag);
assert_bootstrap_fixture_paths_match_regen_keys(&dag);
dag.populate_primitive_cache();
crate::int_literal_ranges::validate_rust_pilot_integer_primitives(&mut dag);
dag
Expand Down Expand Up @@ -3612,7 +3612,7 @@ impl Default for Dag {
/// [`BOOTSTRAP_FIXTURE_PATH_KEYS`](crate::bootstrap::BOOTSTRAP_FIXTURE_PATH_KEYS)
/// must list the same virtual paths in the same order — the const is the regen
/// filter; the `.dag` declaration is runtime authority.
fn assert_extdeps_bootstrap_fixture_paths_match_regen_keys(dag: &Dag) {
fn assert_bootstrap_fixture_paths_match_regen_keys(dag: &Dag) {
let Some(paths) = dag.bootstrap_fixture_virtual_paths() else {
panic!(
"bootstrap snapshot must expose `bootstrap_fixture_authority` as a \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ src/v3/std/dimensions.dag 21 40239 d595746d2bda22f6
src/v3/std/effects.dag 53 97984 1acdbeaa68acfd2e
src/v3/std/emit_model.dag 35 65950 80de7505c56ef93a
src/v3/std/extdeps_bootstrap_fixtures.dag 4 12090 e307b3796658c074
src/v3/std/go_method_template_contracts.dag 5 93546 b383eacaafd0dc1c
src/v3/std/go_method_template_contracts.dag 3 2219 c2fc5e4e64e88688
src/v3/std/induction.dag 56 88794 546f74c63c189c50
src/v3/std/lens.dag 6 9852 28d5539a5b28716e
src/v3/std/list.dag 19 40269 8c648d4a4fd05c21
Expand Down
194 changes: 44 additions & 150 deletions src/v3/std/go_method_template_contracts.dag
Original file line number Diff line number Diff line change
Expand Up @@ -3,158 +3,52 @@
// `rust_method_template_contracts.dag` for the full scope / authority /
// home / convention notes.
//
// GO-SPECIFIC NOTES:
// - The legacy emit authority (`go_method_templates: Map<String, String>`
// in `dsl/extdeps/languages/go/emit.dag`) does not carry
// `wraps_result`. Per Q4 four-property gate, every row's
// `wraps_result` is structurally `false` for Go — declared
// explicitly here, NOT silently inherited from Rust.
// - `string_contains` is in `go_method_templates` but NOT in the
// `dsl/std/methods.dag` registry (registry covers `algebra.dag`
// template-list names; `string_contains` is target-only). Open
// classification question deferred to Phase 2 / Modeling per
// manager call (#1133 msg ID 4343454397). No row authored in
// Phase 1; legacy emit map continues serving v2.
// - `{arg0}` → `{arg}` rewrite applied to runtime templates (`join`,
// `split`); rows use `placeholder_convention: NamedArg` uniformly.
// - `chars` is present only in `collection_method_translations`
// (Go runtime). The runtime template `strings.Split({recv}, "")`
// embeds an escaped empty-string literal (`\"\""`) which the
// current `.dag` tokenizer fails to lower as a structural list
// element (the body falls back to `ValueBody::Unparsed`). Skipping
// the row in Phase 1 keeps the list lowerable; legacy Go runtime
// authority continues serving v2 until Phase 2 retires it. The
// escaped-empty-string handling is a tokenizer-level question
// orthogonal to row population — flag for Phase 2 / parser-level
// follow-up rather than block Phase 1 dispatch.
// - Methods present only in `go_method_templates` (concat, map,
// filter, any, all, flat_map, skip, take, fold, sort_by, append)
// use the emit template for both row sides for the symmetric
// reason.
// **HOT-FIX STATE (2026-04-29):** the Go list is empty pending parser
// investigation. Even a minimal one-row body identical to the
// successful Python row lowers as `ValueBody::Unparsed` — the failure
// is reproducible against the trimmed Go file, not specific to any
// single template content. This blocked main post-#1195 merge with a
// `ResolveError` against the Unparsed body's structural-type check;
// emptying the list unblocks main while the tokenizer/parser-level
// gap is investigated.
//
// Suspected causes (ordered by likelihood; investigation deferred):
// 1. File ordering interaction with `bootstrap_fixture_authority`
// load — Go is the third per-target file processed; same content
// that succeeds for Rust/Python in earlier slots may fail for Go.
// 2. Some decl-id-resolution side effect across-file when the same
// `*_method` registry decls are imported by multiple sibling
// files.
// 3. Tokenizer-level edge case specific to filename or module path
// `v3.std.go_method_template_contracts` not present for
// `rust_method_template_contracts` or `python_method_template_contracts`.
//
// Go rows still pending population once the parser-level cause is
// identified. Legacy Go authorities (`MethodTranslation` in
// `dsl/extdeps/languages/go/runtime.dag`; `go_method_templates: Map`
// in `dsl/extdeps/languages/go/emit.dag`) continue serving v2 emit.
//
// **Tracked dissolution** (per `INVARIANTS.md` scaffold discipline):
// - Owner: R2 Substrate Manager (jolly-ram-908) — parser-level
// investigation routed via R2 Grounding Manager (silent-ant-322)
// 2026-04-29 (#1133 inbox msg ID 4343698210). Cross-manager queue
// tracks at #1130.
// - Trigger: parser-level cause identified. Cheapest reproduction
// entry point: rotate per-target file order in
// `src/v3/std/extdeps_bootstrap_fixtures.dag` and observe whether
// Go rotates into a successful slot — that confirms or rules out
// suspected cause #1.
// - Action on trigger: redo Go row population mirroring the Rust
// and Python sibling files; this comment block deletes; v2 Go
// emit consumers migrate to the row authority in Phase 2.
// - Timebox: bounded by the Phase 1.5 cleanup wave that already
// covers `string_contains` classification + Rust higher-order
// dual-template substrate-shape decision (manager dispatch queue
// post-#1196 merge); no separate milestone needed.

module v3.std.go_method_template_contracts

import v3.std.emit_model {
MethodTemplateContract,
PlaceholderConvention,
NamedArg
}
import v3.std.methods { MethodRef }
import std.methods {
count_method,
join_method,
split_method,
concat_method,
map_method,
filter_method,
any_method,
all_method,
flat_map_method,
skip_method,
take_method,
fold_method,
sort_by_method,
append_method
}
import v3.std.emit_model { MethodTemplateContract }


data go_method_template_contracts: List<MethodTemplateContract> = [
{
dag_method: { decl: count_method },
runtime_template: "len({recv})",
emit_template: "len({recv})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: join_method },
runtime_template: "strings.Join({recv}, {arg})",
emit_template: "strings.Join({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: split_method },
runtime_template: "strings.Split({recv}, {arg})",
emit_template: "strings.Split({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: concat_method },
runtime_template: "append({recv}, {arg}...)",
emit_template: "append({recv}, {arg}...)",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: map_method },
runtime_template: "v2rt.Map({recv}, {arg})",
emit_template: "v2rt.Map({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: filter_method },
runtime_template: "v2rt.Filter({recv}, {arg})",
emit_template: "v2rt.Filter({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: any_method },
runtime_template: "v2rt.Any({recv}, {arg})",
emit_template: "v2rt.Any({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: all_method },
runtime_template: "v2rt.All({recv}, {arg})",
emit_template: "v2rt.All({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: flat_map_method },
runtime_template: "v2rt.FlatMap({recv}, {arg})",
emit_template: "v2rt.FlatMap({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: skip_method },
runtime_template: "{recv}[{arg}:]",
emit_template: "{recv}[{arg}:]",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: take_method },
runtime_template: "{recv}[:{arg}]",
emit_template: "{recv}[:{arg}]",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: fold_method },
runtime_template: "v2rt.Fold({recv}, {arg})",
emit_template: "v2rt.Fold({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: sort_by_method },
runtime_template: "v2rt.SortBy({recv}, {arg})",
emit_template: "v2rt.SortBy({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
},
{
dag_method: { decl: append_method },
runtime_template: "append({recv}, {arg})",
emit_template: "append({recv}, {arg})",
wraps_result: false,
placeholder_convention: NamedArg
}
]
data go_method_template_contracts: List<MethodTemplateContract> = []
Loading