Skip to content

T-4 go.dag — primitive fact-bundles + ModelCore wave-1 (rust.dag pattern) - #3569

Merged
briansrls merged 15 commits into
mainfrom
session/snappy-bear-761
May 22, 2026
Merged

briansrls merged 15 commits into
mainfrom
session/snappy-bear-761

Conversation

@briansrls

@briansrls briansrls commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • cargo run --bin v2-compiler -- compile --source-root src/v4 --output-dir /tmp/out --target rust — 0 diagnostics
  • python3 scripts/strict_deprose_dag.py --check — OK

@briansrls
briansrls marked this pull request as ready for review May 22, 2026 04:24
@briansrls briansrls changed the title Language fact-bundle expansion — Python (operator highest-value), C++, Java, Kotlin, Swift, JS, SQL, WASM + Spice, English, Lean; dispatch per-language workers under your lane, parallel to extdeps/languages/rust.dag pattern T-4 go.dag — primitive fact-bundles + ModelCore wave-1 (rust.dag pattern) May 22, 2026
…CI)

Regenerate Owns lines after Map-migration symbol churn so
strict_deprose_dag --check passes on the allowlisted extdeps slices.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Codex APPROVE (#16452) — verified, no code change required.

Re-read the diff at HEAD against INVARIANTS.md / docs/modeling-discipline.md Practice 8:

CI follow-up (this thread): pushed strict_deprose_dag --check header sync for llvm_ir.dag / typescript.dag (Owns-line drift after Map migration symbol renames) — that was the failing gate on the prior HEAD, not a modeling finding.

— sent from snappy-bear-761

Fold closeout-child swift slice into manager lane (#3569): Swift Book
scalar fact-bundles + manual compile anchor; avoids duplicate Map-migration
PR (#3571).

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Cursor APPROVE (#16489 on 3e4cae5a5) — verified, no code change.

Re-read at current HEAD (928188006 adds vivid-swift parse smokes only; go/swift/Map slice unchanged vs reviewed SHA):

  • go_model_core_wave1 E-6(b) consumer-less scaffold + T-11 dissolve-on at go.dag:809-812 — matches rust/python wave-1 pattern.
  • Map spec_facts migrations align with model_core.dag on main; no hollow aliases in changed lines.

Exploratory (non-blocking): Swift int/float width tags sharing swift_tag_bits32/64 vs Go’s separated tags — noted; acceptable wave-1 while width facts stay type-directed via substrate carriers. SwiftIntegerOverflowSemantics {} placeholder vs Go overflow coproduct — wave-2/T-11 follow-on; bool grounding already marked 🟡 on swift.

Awaiting second distinct provider approval + CI green on 928188006.

— sent from snappy-bear-761

briansrls and others added 2 commits May 22, 2026 01:14
- Drop unit-variant `{}` data bindings (v3 parse rejects LBrace); inline
  overflow coproduct arms in integer fact rows like java.dag.
- Smoke harness: remove missing go_language_model_anchor include; assert
  go_wave1_primitive_fact_bundles + go_model_core_wave1 only (no GoLanguageModel
  on this branch — held on session/vivid-swift-798 for post-pause).

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Claude APPROVE (#16502 on 65d231637) — verified, no code change.

Spot-checks hold on current HEAD:

Exploratory (non-blocking): table-driven language parse smokes as the file grows — agreed; follow-on after pause.

CI re-running on this SHA (65d231637 go parse + smoke fix); awaiting green ci job before operator merge.

— sent from snappy-bear-761

@briansrls

Copy link
Copy Markdown
Contributor Author

Claude APPROVE (#16514 on 6994ad570) — verified, no code change.

Spot-check on reviewed HEAD:

  • Go/swift wave-1 fact-bundle + Map<Symbol, Node> spec_facts pattern matches rust/java; map_insert/empty_map ambient resolution unchanged from substrate convention.
  • go_model_core_wave1 E-6(b) at go.dag:806-809 with named T-11 dissolve-on — scaffold discipline satisfied.
  • typescript.dag imports Empty for fold_list empty seed (import v4.std.algebra { BooleanAlgebra, Empty, fold_list }) — present on branch.
  • Go smoke (~22 lines) extends existing harness; no new hand-Rust modules.

Exploratory (non-blocking): Owns-header grouping as wave-2 grows; variadic map_of to dedupe _primitive_fact_map_N helpers — agreed as future cost-of-change, not this PR.

Note: 6994ad570 is a merge of main (#3551 lattice follow-up) into the lane branch — out of T-4 scope but does not invalidate the substrate review above.

— sent from snappy-bear-761

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 6994ad57 · Trigger: schedule
  • Thinking: 274s wall

BLOCKING (2)

Root Cause

  • src/v4/extdeps/languages/go.dag integer fact axes were copied into parallel fields instead of deriving signedness/overflow from one canonical width/kind carrier → collapse to one signed/unsigned integer fact shape or make signedness a projection from GoIntegerWidth.
  • src/v4/extdeps/languages/swift.dag nonnumeric scalar and representation facts are modeled as independent axes → split to a nonnumeric-only scalar carrier or make each nonnumeric variant carry its matching representation.

⚠️ Two substrate model shapes permit impossible fact combinations, and fixing them now prevents those carriers from becoming downstream authority.

Comment thread src/v4/extdeps/languages/go.dag Outdated

type GoIntegerPrimitiveFacts {
surface_spelling: Symbol
signedness: GoIntKind

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: GoIntegerPrimitiveFacts stores signedness separately from GoIntegerWidth and overflow, so Signed plus GoUnsignedWidth or unsigned overflow is constructible; this violates INVARIANTS P2 / illegal-states-unrepresentable for substrate fact-bundles.

Comment thread src/v4/extdeps/languages/swift.dag Outdated

type SwiftNonNumericPrimitiveFacts {
surface_spelling: Symbol
scalar: SwiftScalar

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: SwiftNonNumericPrimitiveFacts accepts the full SwiftScalar coproduct, so a nonnumeric row can be IntScalar or pair BoolScalar with StringRepresentationFact; this violates INVARIANTS P2 / illegal-states-unrepresentable.

@briansrls
briansrls merged commit 50ae900 into main May 22, 2026
2 checks passed
@briansrls

Copy link
Copy Markdown
Contributor Author

Blocking P2 review — addressed (verified on merge commit 50ae900bc)

Reviewed against the findings at 6994ad57. Both were valid; fixes landed before merge in 909092b64 / dcd7e4431 (squash: 50ae900bc).

1. go.dag — integer fact carrier (was parallel axes)

Before: GoIntegerPrimitiveFacts record with independent signedness, GoIntegerWidth, and overflow → illegal combos (e.g. Signed + GoUnsignedWidth).

After: Coproduct arms tie width kind to signedness/overflow projection:

  • GoSignedIntegerPrimitiveFacts { surface_spelling, width: SignedIntWidth, encoding, std_projection }
  • GoUnsignedIntegerPrimitiveFacts { surface_spelling, width: UnsignedIntWidth, encoding, std_projection }

go_integer_facts_node / go_primitive_bundle_from_integer_facts match on the arm and project Signed/Unsigned + truncate-on-overflow from the variant (not parallel fields). Removed GoIntegerWidth wrapper.

2. swift.dag — nonnumeric facts (was independent scalar + value_fact)

Before: SwiftNonNumericPrimitiveFacts { scalar: SwiftScalar, value_fact: SwiftNonNumericValueFact } → e.g. IntScalar + StringRepresentationFact representable.

After: Per-kind coproduct — each arm carries its matching representation:

  • SwiftBoolPrimitiveFacts / SwiftCharacterPrimitiveFacts / SwiftStringPrimitiveFacts / SwiftVoidPrimitiveFacts

Catalog rows and bundle/substrate builders updated; scalar classifier and representation nodes are projections from the coproduct arm.

Verification

  • v2-compiler compile --source-root src/v4 — 0 diagnostics
  • cargo test -p v3-compiler v4_go_language — pass

— sent from snappy-bear-761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant