You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self-hosting: GNAF certification and the target calculus's evaluator and realization library as language-1.2 source #275
Child of #92 (stage 8 of #27). Part of v0.4's objective: LexLean compiles itself.
Scope
Compiler code not covered by BS-04..BS-08: GNAF requests and certification (gnaf.rs, gnaf/; SPEC §17.15, §17.18), and the parts of calculus/ beyond the checker and the Rust backend: the evaluator, the realization library and the identity of calculus programs (§17.14).
Done when
Each is a certified production root whose package agrees with the Rust oracle byte for byte on every committed request, certificate, target program and fixture.
Each part follows the standing R3 discipline of #15: register rows in model/ids.toml and SPEC §31, one scenario and one conformance_<id> test per row, positive and negative fixtures, a planted defect recorded in VERIFICATION.md, and the Rust module kept as the stage-0 oracle (differential to the byte) until the fixed point of #273 removes it.
Taking #275, starting with its GNAF part. Nothing is built yet; this is the shape, for correction before the first draft.
Overlap checked. No open PR or branch touches gnaf.rs, gnaf/, compiler/gnaf, compiler/certificates, or calculus::{interp, realization}. The open drafts are BS-06/07 (#253, #258, #266), #91 stage 4 (#254, #255, #259, #262, #264, #265: runtime syntax and heap model, not GNAF), and #261, #256, #247 and the #115 series. claude/issue-22-gnaf-universe and claude/issue-23-gnaf-certification are the old v0.2 branches. Row numbers: BS-06/07 are in #253/#258, BS-08 is #272, BS-09 is in #259, so the GNAF rows start at BS-10. Each number is fixed when its row is claimed, in case another row lands first.
What the GNAF part is. The oracle is crates/lexlean/src/gnaf.rs (1,781 lines) and gnaf/certification.rs (1,489). The kernel model compiler/src/Gnaf and Certification stay the normative definitions (§17.15, §17.18). The new roots are held to the Rust transcription to the byte, as #275 asks, and through it to the committed answers the kernel already confirms. The oracle splits into five parts. Four need no evaluator. The fifth is the premise facts, which evaluate systems and so wait on the evaluator part of this issue.
certification::check_inner with the premise facts as an argument; the certificate's capacity check
about 700
about 1.75 MB, 56%; split by route if the first measure is over 60%
later
the premise facts (premise_fact, observations, preserves, is_normal)
certification.rs
about 350
after the evaluator row
The estimates use BS-07's measured 2,500 bytes of certificate per oracle line (applyMoves). That figure comes from one recursive pass over Expr, so these are guesses until each first export. The first PR reports its measured parts, and each later row is measured before the next is built. load (spec tag, host capacity, grammar signature, thresholds, plan preparations) joins BS-12 or becomes its own row once universe_id can be source. That waits on #276's canonical JSON writer, and the check and evaluation it calls are BS-04's roots and the evaluator.
BS-10 in detail (the first PR).
Arguments.validate reads no program and no value. It reads the domain's length, the carrier's kind, the plan count, each plan's preparations, the threshold count, the machine, the completeness evidence, the objective, the claim, and the scope. The root takes exactly that projection of the request: a record with the domain's length, the machine (fuel, capacity, operand size, actions, boundary, and each prepared artifact's action), and a carrier whose grammar keeps each plan's preparations and the thresholds. The reference program, the domain's values, the plans' functions, the argument and result types, the artifacts' digests, and the strings of profile_defined_comparison are not arguments. The row says this in its statement. The host projects each Request, and the oracle runs on the full Request.
Sorts. No recursive sort of the module's own. The one nesting is a list of plans, each holding a list of actions. A throwaway root first checks whether certificate A takes it. If it does not, the plans' preparations are carried flattened in plan order, with the plan count, which is all validate reads.
Oracle and corpus.gnaf::validate is public and outside the renderer's files, so no oracle change and no identity moves. The corpus is the 60 committed requests of compiler/gnaf/ (36 refused, 14 argmin, 5 frontier, 4 incomplete, 1 infeasible) and the requests the 73 certificate fixtures of compiler/certificates/ name. On top of those come hand-built requests that reach each of the 21 rejections, and each of the 10 action kinds for the six rejections that carry one where it is reachable, three times each. validate is total over Request values, so the vectors include requests that load would refuse. Field-level seeded mutants of the committed requests (every field above) can be large, because no program is evaluated.
Outcome compared. Acceptance, and the rejection as the oracle's serde_json bytes, to the byte.
Legs. As BS-04/05. On every host: the rendered package under the pinned rustc on the deterministic vectors. On the normative host: the lowered program under the calculus evaluator on the committed requests, the rule vectors, and a seeded corpus; the package on a larger seeded corpus; the plants; and the export equal to tests/production-export/bootstrap/. The case asserts that the largest certificate part is under 3,145,728 bytes.
Plants (candidates, about 12). The empty-domain check after the carrier; a constant charge of 0 accepted; a free preparation accepted under the complete boundary; a prepared artifact matched against steps instead of free; a duplicate counted at one occurrence; fallback missing from the performed kinds; the domain capacity compared with >=; the universe size as n + |T|·n for n + |T|·n²; restricted_universe_optimal refused as unsupported instead of an alias; the scalar and vector claim checks swapped; rust_programs scope admitted; the unit operand-size check before the capacity check. The case records each plant's first disagreement in VERIFICATION.md.
Records. The ids.toml and SPEC §31 rows, the §17.23 paragraph, the bootstrap.feature scenario, and a failing conformance_bs_10 are the first commit. Records bound to identities (lock, bootstrap/expected, the production export, the stack rows) are relocked locally to run the case and left to your regeneration, as for BS-04..07.
After the GNAF part, the rest of #275 is the evaluator (calculus::interp, 729 lines, about 1.8 MB estimated, so likely one root per evaluation mode), the realization library (realization.rs, 1,466 lines, split by measurement), and the identity of calculus programs (§17.14, Program::id: the renamer and the canonical writer). The identity overlaps BS-08's module-local RustProgram writer, so it reuses that writer after BS-08 and #276 instead of writing a second one. I will post each part's shape here before building it.
One question for you.compiler/src/Gnaf.validate, gnaf::validate, and GnafValidate.validateRequest will be three definitions of one function. Until #273 the Rust stays as the oracle. At the fixed point, should the bootstrap root also be tied to the kernel model, for example by the GNAF fixtures' expected answers? Or does the model stay the normative copy beside a certified one? This is a note for §17.23, not work for this PR.
Branch claude/issue-275-gnaf-validate, draft PR to follow, based on release/v0.4.
changed the title [-][v0.4] Self-hosting: GNAF certification and the target calculus's evaluator and realization library as language-1.2 source[/-][+]Self-hosting: GNAF certification and the target calculus's evaluator and realization library as language-1.2 source[/+]on Oct 22, 2026
Update to the claim of 2026-10-22. The shape of the GNAF part stands; the row numbers and the base have moved, so I fix them here before the first commit.
Row numbers.BS-10 to BS-14 are now registered by the lowering stack (#315, register 461), and BS-15 is claimed by #272. The GNAF rows take the next four, fixed now:
certification::check_inner with the premise facts as an argument
The premise facts stay a later row, after the evaluator. If another row lands first, I renumber in this issue before my first commit, not after.
Base.release/v0.4 at a1b925d. BS-16 reads no lowering root, so it does not stack on #315. The oracle is unchanged: gnaf.rs is 1,781 lines, gnaf/certification.rs 1,489, gnaf::validate is still public at line 836, and compiler/gnaf/ still holds the 60 committed requests and compiler/certificates/ the 73 fixtures.
Overlap, re-checked on 2026-10-29. No open PR or branch touches gnaf.rs, gnaf/, compiler/src/Gnaf, compiler/src/Certification, compiler/gnaf or compiler/certificates. Two things matter for later parts only: #239 (claude/issue-115-lowering, base release/v0.5) changes 10 lines of calculus/interp.rs, which the evaluator part will have to follow; and the old branch issue-114-widening (no PR, last commit 2026-10-16) adds 24 lines to calculus/realization.rs. Neither touches BS-16.
Shape of BS-16, unchanged. The root takes the projection of Request that validate reads (domain length, machine, carrier kind with each plan's preparations and the thresholds); the host projects, the oracle runs on the full Request. Compared to the byte: acceptance, and the rejection as serde_json bytes. Plants, corpus, records and legs are as in the first claim. The failing conformance_bs_16 is the first commit. Branch claude/issue-275-gnaf-validate; nothing is pushed.
Activity
humuhumu33 commentedon Oct 22, 2026
Taking #275, starting with its GNAF part. Nothing is built yet; this is the shape, for correction before the first draft.
Overlap checked. No open PR or branch touches
gnaf.rs,gnaf/,compiler/gnaf,compiler/certificates, orcalculus::{interp, realization}. The open drafts are BS-06/07 (#253, #258, #266), #91 stage 4 (#254, #255, #259, #262, #264, #265: runtime syntax and heap model, not GNAF), and #261, #256, #247 and the #115 series.claude/issue-22-gnaf-universeandclaude/issue-23-gnaf-certificationare the old v0.2 branches. Row numbers: BS-06/07 are in #253/#258, BS-08 is #272, BS-09 is in #259, so the GNAF rows start at BS-10. Each number is fixed when its row is claimed, in case another row lands first.What the GNAF part is. The oracle is
crates/lexlean/src/gnaf.rs(1,781 lines) andgnaf/certification.rs(1,489). The kernel modelcompiler/src/GnafandCertificationstay the normative definitions (§17.15, §17.18). The new roots are held to the Rust transcription to the byte, as #275 asks, and through it to the committed answers the kernel already confirms. The oracle splits into five parts. Four need no evaluator. The fifth is the premise facts, which evaluate systems and so wait on the evaluator part of this issue.rust-std)GnafValidate:validateRequest (request : Request) : Option Rejectiongnaf::validateand its checks,universe_sizeGnafAnswer:answerOf,certifiesAnswer,minimaAttained, given the statusesevaluate_answerafterstatuses,argmin,frontier,dominates,componentwise_minimum,attains,certifies,minima_attainedGnafUniverse:expandCarrier,realizeSystem,programSize,systemChargeexpand,well_formed,entry_body,realize,callees,reachable,expr_size,program_size,unit_charge,system_chargeCalculusCheck's program sortsGnafCertify:certificateVerdict (request) (certificate) (facts)certification::check_innerwith the premise facts as an argument; the certificate's capacity checkpremise_fact,observations,preserves,is_normal)certification.rsThe estimates use BS-07's measured 2,500 bytes of certificate per oracle line (
applyMoves). That figure comes from one recursive pass overExpr, so these are guesses until each first export. The first PR reports its measured parts, and each later row is measured before the next is built.load(spec tag, host capacity, grammar signature, thresholds, plan preparations) joins BS-12 or becomes its own row onceuniverse_idcan be source. That waits on #276's canonical JSON writer, and the check and evaluation it calls are BS-04's roots and the evaluator.BS-10 in detail (the first PR).
validatereads no program and no value. It reads the domain's length, the carrier's kind, the plan count, each plan's preparations, the threshold count, the machine, the completeness evidence, the objective, the claim, and the scope. The root takes exactly that projection of the request: a record with the domain's length, the machine (fuel, capacity, operand size, actions, boundary, and each prepared artifact's action), and a carrier whose grammar keeps each plan's preparations and the thresholds. The reference program, the domain's values, the plans' functions, the argument and result types, the artifacts' digests, and the strings ofprofile_defined_comparisonare not arguments. The row says this in its statement. The host projects eachRequest, and the oracle runs on the fullRequest.validatereads.gnaf::validateis public and outside the renderer's files, so no oracle change and no identity moves. The corpus is the 60 committed requests ofcompiler/gnaf/(36 refused, 14 argmin, 5 frontier, 4 incomplete, 1 infeasible) and the requests the 73 certificate fixtures ofcompiler/certificates/name. On top of those come hand-built requests that reach each of the 21 rejections, and each of the 10 action kinds for the six rejections that carry one where it is reachable, three times each.validateis total overRequestvalues, so the vectors include requests thatloadwould refuse. Field-level seeded mutants of the committed requests (every field above) can be large, because no program is evaluated.serde_jsonbytes, to the byte.tests/production-export/bootstrap/. The case asserts that the largest certificate part is under 3,145,728 bytes.constantcharge of 0 accepted; a free preparation accepted under thecompleteboundary; a prepared artifact matched againststepsinstead offree; a duplicate counted at one occurrence;fallbackmissing from the performed kinds; the domain capacity compared with>=; the universe size asn + |T|·nforn + |T|·n²;restricted_universe_optimalrefused as unsupported instead of an alias; the scalar and vector claim checks swapped;rust_programsscope admitted; the unit operand-size check before the capacity check. The case records each plant's first disagreement in VERIFICATION.md.bootstrap.featurescenario, and a failingconformance_bs_10are the first commit. Records bound to identities (lock,bootstrap/expected, the production export, the stack rows) are relocked locally to run the case and left to your regeneration, as for BS-04..07.After the GNAF part, the rest of #275 is the evaluator (
calculus::interp, 729 lines, about 1.8 MB estimated, so likely one root per evaluation mode), the realization library (realization.rs, 1,466 lines, split by measurement), and the identity of calculus programs (§17.14,Program::id: the renamer and the canonical writer). The identity overlaps BS-08's module-localRustProgramwriter, so it reuses that writer after BS-08 and #276 instead of writing a second one. I will post each part's shape here before building it.One question for you.
compiler/src/Gnaf.validate,gnaf::validate, andGnafValidate.validateRequestwill be three definitions of one function. Until #273 the Rust stays as the oracle. At the fixed point, should the bootstrap root also be tied to the kernel model, for example by the GNAF fixtures' expected answers? Or does the model stay the normative copy beside a certified one? This is a note for §17.23, not work for this PR.Branch
claude/issue-275-gnaf-validate, draft PR to follow, based onrelease/v0.4.Generated by Claude Code
[-][v0.4] Self-hosting: GNAF certification and the target calculus's evaluator and realization library as language-1.2 source[/-][+]Self-hosting: GNAF certification and the target calculus's evaluator and realization library as language-1.2 source[/+]humuhumu33 commentedon Oct 29, 2026
Update to the claim of 2026-10-22. The shape of the GNAF part stands; the row numbers and the base have moved, so I fix them here before the first commit.
Row numbers.
BS-10toBS-14are now registered by the lowering stack (#315, register 461), andBS-15is claimed by #272. The GNAF rows take the next four, fixed now:GnafValidate:validateRequestgnaf::validate,universe_sizeGnafAnswer:answerOf,certifiesAnswer,minimaAttainedevaluate_answerafterstatusesGnafUniverse:expandCarrier,realizeSystem,programSize,systemChargeexpandthroughsystem_chargeGnafCertify:certificateVerdictcertification::check_innerwith the premise facts as an argumentThe premise facts stay a later row, after the evaluator. If another row lands first, I renumber in this issue before my first commit, not after.
Base.
release/v0.4at a1b925d. BS-16 reads no lowering root, so it does not stack on #315. The oracle is unchanged:gnaf.rsis 1,781 lines,gnaf/certification.rs1,489,gnaf::validateis still public at line 836, andcompiler/gnaf/still holds the 60 committed requests andcompiler/certificates/the 73 fixtures.Overlap, re-checked on 2026-10-29. No open PR or branch touches
gnaf.rs,gnaf/,compiler/src/Gnaf,compiler/src/Certification,compiler/gnaforcompiler/certificates. Two things matter for later parts only: #239 (claude/issue-115-lowering, baserelease/v0.5) changes 10 lines ofcalculus/interp.rs, which the evaluator part will have to follow; and the old branchissue-114-widening(no PR, last commit 2026-10-16) adds 24 lines tocalculus/realization.rs. Neither touches BS-16.Shape of BS-16, unchanged. The root takes the projection of
Requestthatvalidatereads (domain length, machine, carrier kind with each plan's preparations and the thresholds); the host projects, the oracle runs on the fullRequest. Compared to the byte: acceptance, and the rejection asserde_jsonbytes. Plants, corpus, records and legs are as in the first claim. The failingconformance_bs_16is the first commit. Branchclaude/issue-275-gnaf-validate; nothing is pushed.Generated by Claude Code
Regenerate the bootstrap oracles on the integrated tree and move the …
Move the counts CI named on 7b854b6: BS-05, BS-06, BS-13, BS-14 (BS-16,
Register BS-16 and add the failing conformance_bs_16 (UOR-Foundation#275
Add GnafValidate and the BS-16 case (work in progress, UOR-Foundation…
Settle the BS-16 plants, effects and counts (UOR-Foundation#275)
GnafValidate declares the axioms Lean observes: none (UOR-Foundation#275
Register 460 IDs, add the validate_request root, and state BS-16 in S…