Repository navigation
The v2-native CLI closure emits and builds clean: the seam refusal carries a type, and three carrier conversions were missing - #11507
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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>
82bd0cb to
80b37b2
Compare
There was a problem hiding this comment.
💡 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".
| "v1_rt::unrealized_host_seam::<", | ||
| render_rust_type(n: ret_type, shared_types: shared_types, source_indices: si, emit_info: emit_info), |
There was a problem hiding this comment.
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 👍 / 👎.
…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>
Follow-up to #11474.
gunbc test //gunbc/instruments:v2-native-clireportsexit_status=0 warning_count=0— the v2-native CLI's closure emits and builds clean underRUSTFLAGS="-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, sopanic!("…").len()answered E0599 and everything after itunreachable.The emitter now renders
v1_rt::unrealized_host_seam::<T>(msg), takingTfrom the call's own inferred type — the same wayempty_mapandempty_setin that function already readinferred. 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,concatpast two arguments, the collection folds, the pipelines.v1.compiler.tokenize source_code_point, thenv1.compiler.infer typecheck_module; rebuilt seed panicked on its own first tokenizeemit_typed_call_expr, ahead of the delegationwith, solet 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_rtand after thecall_targetmatch, now takinginferredso 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.lexingdeclaresLiteralPattern { text: v2.std.text.String }— the qualified spelling, so the field is the free-monoid char list on purpose — and its own constructor converts withchars. Two other constructors handed over an ordinary string unconverted, andsemantic_decl_string_to_bundle_nodefolded one throughfrom_code_pointwithout taking the char-list view. Addingchars(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 theStringmeaning fork, so these were reported as instances of it and briefed as blocked behinddocs/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 in01_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)cargo clippy --all-targets -- -D warningscleanTwo earlier zeroes are superseded rather than cited: the first was measured against a binary still carrying attempt 2's
withdefect, the second against the pre-rebase tree. The run that discriminated attempt 2 reportedconvergence_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