Skip to content

The v2-native CLI closure emits and builds clean: the seam refusal carries a type, and three carrier conversions were missing - #11507

Merged
briansrls merged 1 commit into
mainfrom
v2-native-cli
Sep 17, 2026
Merged

briansrls merged 1 commit into
mainfrom
v2-native-cli

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Follow-up to #11474. gunbc test //gunbc/instruments:v2-native-cli reports exit_status=0 warning_count=0 — the v2-native CLI's closure emits and builds clean under RUSTFLAGS="-D warnings". That closure went from 19 rustc errors to 0; #11474 closed the first eight, this closes the rest.

C — an unrealized host seam now carries its own type

The refusal was already right: a primitive whose body is a bare self-call has no behaviour on this target, and emitting that shape verbatim yields a function that compiles and returns to no caller (§5). What panic! alone cannot do is stand where its result is consumed — ! coerces in value position but is not a method receiver, so panic!("…").len() answered E0599 and everything after it unreachable.

The emitter now renders v1_rt::unrealized_host_seam::<T>(msg), taking T from the call's own inferred type — the same way empty_map and empty_set in that function already read inferred. Five errors across two modules, gone, with the divergence intact: the helper has no return path.

Where that arm may be asked is the whole lesson, and it cost two failed attempts

The predicate answers "runtime primitive, no bridge, no projected declaration", and that is the right question only at the residue position, after every earlier arm has declined — because a family of primitives is rendered by dedicated arms carrying no bridge row: with, concat past two arguments, the collection folds, the pipelines.

attempt what it did how it failed
1 — body grain refuse the whole function when its body reaches a seam called every bridgeless builtin unrealized; refused v1.compiler.tokenize source_code_point, then v1.compiler.infer typecheck_module; rebuilt seed panicked on its own first tokenize
2 — one level too early typed refusal in emit_typed_call_expr, ahead of the delegation intercepted with, so let typed_module = with(typed_base, …) took the seam's type; second generation failed to compile (expected Rc<Node>, found Rc<HashMap<_, _>>)

Stage one built clean both times. Only the fixed-point check caught either. The landed arm is the one that already sat after is_rt and after the call_target match, now taking inferred so it can type what it refuses — and the constraint is recorded on the predicate, because it is a fact about where the question may be asked, not about what it computes.

B — three carrier conversions that were simply missing

v2.std.compilers.lexing declares LiteralPattern { text: v2.std.text.String } — the qualified spelling, so the field is the free-monoid char list on purpose — and its own constructor converts with chars. Two other constructors handed over an ordinary string unconverted, and semantic_decl_string_to_bundle_node folded one through from_code_point without taking the char-list view. Adding chars(s: …) at the three sites is the fix.

That attribution was wrong before it was measured, and the correction matters more than the fix. The error signature (expected Rc<im::Vector<i64>>, found String) matches the String meaning fork, so these were reported as instances of it and briefed as blocked behind docs/plans/carrier-realization-arbiter-repair-design.md — 52 sites, arm A's 25 generic-carrier errors, a location-valued identity key, two refuted repairs. None of that was load-bearing here. These are that document's arm B, the arm it states is closable constructor-side, and they close. Arm A is real, unsolved, and lives in 01_tokenize's closure rather than this one.

Evidence — all measured on this tree

  • //gunbc/instruments:v2-native-cli — exit_status=0 warning_count=0, 495s
  • //gunbc/instruments:self-host — exit_status=0 warning_count=0, 586s (the corpus-wide control, because this changes how every unrealized-seam call emits)
  • regen converges with one mirror changed
  • cargo clippy --all-targets -- -D warnings clean

Two earlier zeroes are superseded rather than cited: the first was measured against a binary still carrying attempt 2's with defect, the second against the pre-rebase tree. The run that discriminated attempt 2 reported convergence_stages=2 [stage-1, stage-2] — stage two is where it failed, so that clean build is the evidence the residue placement is right.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-17T04:35:40.673821Z 82bd0cb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…rries a type, and three carrier conversions were missing

`gunbc test //gunbc/instruments:v2-native-cli` reports exit_status=0 warning_count=0 at 495s under
RUSTFLAGS="-D warnings". The closure went from NINETEEN rustc errors to zero across three changes;
this is the last two of them.

C -- AN UNREALIZED HOST SEAM NOW CARRIES ITS OWN TYPE. The refusal itself was already right: a
primitive whose body is a bare self-call has no behaviour on this target, and emitting that shape
verbatim yields a function that compiles and returns to no caller (DESIGN section 5). What `panic!`
alone cannot do is stand where its RESULT IS CONSUMED -- `!` coerces in value position but is not a
method receiver, so `panic!("...").len()` answered E0599 and everything after it `unreachable`. The
emitter now renders `v1_rt::unrealized_host_seam::<T>(msg)` with T taken from the call's OWN INFERRED
TYPE, which is how `empty_map` and `empty_set` in the same function already read `inferred`. Five
errors in two modules, gone, with the divergence intact: the helper has no return path.

WHERE THAT ARM MAY BE ASKED IS THE WHOLE LESSON, AND IT COST TWO FAILED ATTEMPTS. The predicate
answers "runtime primitive, no bridge, no projected declaration", and that is the right question ONLY
at the RESIDUE POSITION, after every earlier arm has declined -- because a family of primitives is
rendered by DEDICATED ARMS carrying no bridge row: `with`, `concat` past two arguments, the
collection folds, the pipelines.

  Attempt 1, body grain: refuse the whole FUNCTION when its body reaches a seam. Type-checks
  trivially. It called every bridgeless builtin unrealized, refused `v1.compiler.tokenize
  source_code_point` and then `v1.compiler.infer typecheck_module`, and the rebuilt seed panicked on
  its own first tokenize. Withdrawn.

  Attempt 2, one level too early: the typed refusal placed in emit_typed_call_expr, ahead of the
  delegation. It intercepted `with` in v1.compiler.infer, so `let typed_module = with(typed_base, ..)`
  took the seam's type instead of the record update's, and the SECOND GENERATION failed to compile
  (`expected Rc<Node>, found Rc<HashMap<_, _>>`). STAGE ONE BUILT CLEAN BOTH TIMES; only the
  fixed-point check caught it.

The landed arm is the one that already sat after `is_rt` and after the `call_target` match, now
taking `inferred` so it can type what it refuses. The constraint is recorded on the predicate, because
it is a fact about where the question may be asked rather than about what it computes.

B -- THREE CARRIER CONVERSIONS THAT WERE SIMPLY MISSING, AND NOT THE FORK THEY LOOKED LIKE.
`v2.std.compilers.lexing` declares `LiteralPattern { text: v2.std.text.String }` -- the QUALIFIED
spelling, so the field is the free-monoid char list on purpose -- and its own constructor converts
with `chars`. Two other constructors handed over an ordinary string unconverted, and
`semantic_decl_string_to_bundle_node` folded one through `from_code_point` without taking the
char-list view. Adding `chars(s: ..)` at the three sites is the fix.

THAT ATTRIBUTION WAS WRONG BEFORE IT WAS MEASURED, and the correction matters more than the fix. The
error signature (`expected Rc<im::Vector<i64>>, found String`) matches the String meaning fork, so
these were reported as instances of it and briefed to the self-host lane as blocked behind
docs/plans/carrier-realization-arbiter-repair-design.md -- 52 sites, arm A's 25 generic-carrier
errors, a location-valued identity key, two refuted repairs. None of that was load-bearing here.
These are that document's ARM B, the arm it states is closable constructor-side, and they close.
Arm A is real, unsolved, and lives in `01_tokenize`'s closure rather than this one.

EVIDENCE, all on the converged compiler rather than the one that produced the first reading.
`//gunbc/instruments:v2-native-cli` exit_status=0 warning_count=0 wall_s=495.
`//gunbc/instruments:self-host` exit_status=0 warning_count=0 wall_s=586 -- the corpus-wide control,
because this changes how EVERY unrealized-seam call emits. The regen round converges with one mirror
changed.

EVERY FIGURE ABOVE IS MEASURED ON THIS TREE, after #11474 squash-merged and this commit was rebased
onto it. Two earlier zeroes are SUPERSEDED rather than cited beside these: the first was measured
against a binary still carrying attempt 2's `with` defect, and the second against the pre-rebase tree.
The convergence run that discriminated attempt 2 reported convergence_stages=2 [stage-1, stage-2] --
stage two is where that attempt failed, so its clean build is the evidence that the residue placement
is right, and it is recorded here as history of the check rather than as a property of this tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82bd0cbec8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/v1/05_emit_rust.dag
Comment on lines +12006 to +12007
"v1_rt::unrealized_host_seam::<",
render_rust_type(n: ret_type, shared_types: shared_types, source_indices: si, emit_info: emit_info),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Regenerate the seed emitter with the typed seam logic

In a clean checkout, the seed compiler still executes src/v1/stage0/src/v1_compiler_emit_rust.rs through v1_compiler_compile.rs, but that generated mirror was not updated: its emit_typed_call still lacks inferred, and its unrealized-primitive branch still emits the untyped func_ident (panic!(...)). Consequently, the documented v2-native CLI scenario continues to generate expressions such as panic!(...).len() and fails with the same E0599/unreachable diagnostics; the new unrealized_host_seam::<T> path exists only in the .dag authority until the emitter mirror is regenerated and committed.

Useful? React with 👍 / 👎.

@briansrls
briansrls added this pull request to the merge queue Sep 17, 2026
Merged via the queue into main with commit 5dbe324 Sep 17, 2026
7 checks passed
@briansrls
briansrls deleted the v2-native-cli branch September 17, 2026 14:41
gunbai-bot Bot pushed a commit that referenced this pull request Sep 17, 2026
…arriers

Follow-up to gunbc#11507's dashboard review 67180, both findings.

A -- THE SEAM RENDERS ONE SHAPE. The typed arm took its turbofish from the call's own `inferred`
and an unresolved site fell to `func_ident`, which at that arm is `emit_error_expr` (`panic!`) by
construction -- a refusal rather than a silent widen, but the one that cannot stand in receiver
position (E0599 plus cascading `unreachable`), which is the whole defect the typed seam was built
to remove. It now renders `::<_>` there and asks rustc for the same answer from the consuming
context: same divergence, and where the context cannot determine T the target answers E0282, loud
and at the site.

The refusal stays at that arm rather than climbing to a pre-emission module refusal
(EmissionConstructUnprojectable). That would be the higher rung if the question were decidable at
body grain, and #11507 measured twice that it is not: a body walk cannot see which primitives the
dedicated arms realize, called `v1.compiler.tokenize source_code_point` unrealized, and panicked
the rebuilt seed on its own first tokenize. The climb this class waits on is a realizability
roster, not a second consumer of this predicate placed earlier. Recorded on the predicate.

B -- THE CARRIER CONVERSION AT EVERY SITE, AND ITS RULE AT THE TYPE. #11507 fixed `rust_lex_rule`,
the one its closure reached; seventeen siblings across `v2.extdeps` were still handing an ordinary
`String` into `LiteralPattern`/`KeywordPattern`, whose fields declare the qualified
`v2.std.text.String` on purpose. `chars(s: ...)` at each. The obligation now sits at the
`LexPattern` declaration in `v2.std.compilers.lexing` rather than as a per-site note, because one
constructor reading right said nothing about its siblings -- which is how they survived a PR whose
subject was this exact class.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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