Repository navigation
Admit expression-bodied fn decls (= expr) on fn_decl - #10961
Conversation
Keep fn_body brace-only so if/block/fn-literal stay unchanged, and lower the eq-rhs through normalize so `fn f(a: Int) -> Int = a` survives graft. Co-authored-by: Cursor <cursoragent@cursor.com>
A *_test.dag with only plain fn leaves universe derivation empty; claim_batch --functions is not discovery. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closure measurement at #10882-head Both sit in the new No closure before/after is reportable for this head. |
last_child without eq was an absorbing fallback; eq is token identity only, matching let navigation. Survives probes now require an arrow body via find_arrow_body_child. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Fixed against review 63223 (
|
Emission rendered Option<Absent> (E0425) and could not infer the eq-token match binder (E0282). Init with optional_absent() so the emitted crate compiles. Co-authored-by: Cursor <cursoragent@cursor.com>
…2-native. #10882 is on main; keep a merge commit (no rebase).
G's optional_absent() repair is source-only. The interpreter still accepts init: Absent where the type is Optional, and emission has rendered Option<Absent>. Cite that shape on accepted_source_emits_uncompilable_target (vii) so ACT realization-fidelity still has a subject. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closure measurement at head
Either way the reduced |
optional_absent() retired E0425; emitted lambdas still render acc: _ so rustc cannot infer Optional's T (E0282). Init and step are now declared functions. The untyped-lambda shape stays as a second emitter-red fixture. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closure before/after for #10961 at head 68 → 67. Zero regressions (no accepted module refuses; no non-G file changed cause; nothing earlier-stage). Cause G (expression-bodied fn,
The sole-G file is the discriminating evidence and it accepted; the three multi-cause files are Meets the cause-relative bar for G. The receipt binds to |
|
review 63274 is right that the two Copying the phantom-marker enrollment ( §3c middle value: consumed by ACT realization-fidelity, via — sent from witty-boar-671 |
Declarations refused DurableOriginRead/DisposableCacheRead without their ReadSource parent. The four native_decl_selection test fns each re-ingested the fixture and crossed the 500ms CPU line; one witness still checks all four discriminators. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 63284 is right that the grammar already names the body as I wired The Not landing the capture-only patch. Not growing a fallback-to-finder-then-eq pair (that would be two authorities). — sent from witty-boar-671 |
#10961 edited accepted_source_emits_uncompilable_target after this branch diverged and this PR edits it too, so the conflict is two edits to one existing row. Resolved by keeping main's content and adding this lane's three receipts to the same list - one definition, not two. Verified the merged row resolves (0 blocking). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…, and share the parse-witness fixture trees warm (#11032) SYMPTOM: main's required floor is red -- ten identities INTERRUPTED-BEFORE-VERDICT at the 500ms per-claim CPU ceiling (cpu_at_least=506-610ms, right-censored) since #10946 and #10961 landed: the seven where-clause rows of v2.test.parse.d1_declaration_grammar_parse, the two carried/graft rows of v2.test.parse.where_refinement_clause_parse, v2.test.claim.body_lowering.declaration_structure_preserved .where_refinement_clause_interior_is_not_retained_holds, and v2.test.parse.expression_bodied_fn_decl_parse.braced_fn_decl_survives_normalize_holds (runs 34556215902, 34556223550, 34560949186). No floor run has ever reached their verdict. COST SHAPE, measured not inferred. Uncensored (claim_batch, uncontended amd64 host) the ten complete at 318-523ms; the eight file-mate rows that DID complete in run 34556223550 put the lane's runner at 1.4-2.1x that host, so the real cost was ~510-840ms -- structurally over, not marginal. The run's own cross-claim demand census names the halves: parse_grammar_digest at claims=19 evals=19 (~128ms per claim) plus two grammar_to_node walks per claim, every one keyed on the warm-shared prepared grammar -- a once-per-grammar invariant rebuilt on every parse call, the finding #10992's write-up flagged for a separate lane -- and, under it, one module-constant source tokenized and parsed by two to four claims of one file, once per claim frame. Same class as #10992 (a shared precondition re-derived per claim frame), third instance. REPAIR, at both homes, never the line: - v2.compiler.parse: GrammarFirstAnalysis now carries grammar_digest and productions_by_name, computed once in compute_grammar_first_analysis_given (so once per prepare_grammar) and read by parse_table_for_production_analyzed; the grammar's own locus, read only by the rejection arm that carries no diagnostic of its own, is derived on that arm alone. Every claim that parses .dag text inherits this. - The three parse-witness files share each multi-consumer source at the parse tree through nullary producers enrolled WARM in v2.workflow.floor_pure_producer_share (eight rows); normalize stays per claim. Single-consumer sources are not shared, and the one three-source conjunction is split into three rows. Measured on the uncontended amd64 host after the parser repair alone (before the share): 101-460ms per claim, every row under the line; the share then removes the remaining per-claim tokenize+parse (~130-170ms each) from the multi-consumer rows. Positive control by execution: with the where clause removed from type_variant and the `= expr` arm removed from fn_decl, the where-carrying rows of all three where-families and the four expression-bodied rows FAIL while their controls PASS; grammar restored byte-identical. No assertion deleted or weakened; no ceiling change. Claude-Session: https://claude.ai/code/session_01YApoxsmnC96ad2nWpRJdja Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
fn f(a: Int) -> Int = aparses and survives normalize/graft.= expris a choice ondag_grammar_fn_decl_expronly;fn_bodystays brace-only so if/block/fn-literal are unchanged.fn f() -> Int =is refused. Bracedfn f() -> Int { a }still parses and normalizes.body_lower_eq_body_fold_init() -> Optional<Node>and typed step fns. That is a self-host source repair. Constructor realization remains open:fixtures/fixture_closure_rustc/bare_absent_fold_init.dagandfixtures/fixture_closure_rustc/typed_optional_fold_init_lambda.dag, cited ongunbc.recurring_failure_modeaccepted_source_emits_uncompilable_target(component vii).Test plan
Cause-relative bar: cause G ceases on every attributed subject; each file accepts or advances to a typed cause this PR does not own; no previously accepted member regresses; newly exposed causes are recorded; the
= exprstructure survives parse and normalize in its intended modeled form. Never “the file leaves the refusing set”.Required CI is build + floor. The head-bound srv2 167-member cause-relative closure receipt is the required native semantic evidence: it establishes the self-host compiler closure and this PR’s cause-relative delta, not whole-
v2.test.*native admission, and does not retirev2_native_route_off_the_merge_path.The
b5cefb6creceipt (emitted crate builds; 68 → 67, zero regressions) is interim. Head is8ca64962with no net file change from that sha; a fresh post-D1 receipt at G’s landing head is required.b5cefb6c)unicode/types.dag(sole G)RefusalClearedcontent_hash.dagmeasure.dagpareto.dagLands after #10988 → D2 → D3 → D1.