Repository navigation
feat(language-1.2): context windows and greedy and seeded text generators (LM-04..LM-06; part of #30) - #176
humuhumu33 wants to merge 3 commits into
Conversation
…tors (LM-04..LM-06; part of #30) A context_window elaborates to capacity, fit and push over the text-laws library and generates bounded, push_bounded, exact, and suffix (keep_last) or refuses (refuse). A text_generator over a prior tokenizer, window, stateless list uint32 -> list int model and uint32 stop token elaborates to score, the closed inductives End and Failure, run (the library's loop, structural in max_tokens), generateTokens and generate, and generates bounded and context_bounded. greedy takes no seed; sample threads an explicit uint32 seed through the closed xorshift32 and proportional members. Both declarations gain an axioms policy; capacity or max_tokens 0 is the new LLT4016. The laws are new declarations of the native LexLeanText module, migrated by the round trip of slice 1 (second record in tests/text-laws/MIGRATION.md). semantic_ir 13, latex_backend 13; register 406. Generated records are regenerated after the main merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-30-slice2 The text library takes #155's rename of its private names to the module it compiles as (_private.LexLeanText.LexLeanText.#0), applied to the 21 names slice 2 adds as well. The register is 404 on main plus LM-04..LM-06: 407, set by hand in README, the SPEC §31 total, repository.rs and spec_links.rs. Generated records are regenerated on the merged tree next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ee merged with main 8765fee The language-1.2 compiler-semantics ID moves 63dd4c08 -> d485922b (semantic_ir 13, latex_backend 13, the extended text library, the production notes). Every lock, golden, calculus file, fixture expectation, production export and verification record is regenerated in dependency order (build, relock, golden, calculus, build, relock, model, fixtures, production-export, verify-examples with uor-atlas aside); CONFORMANCE.md follows the register. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Suggested order for the identity-moving regenerations, so each sweep runs once: #171 (BS-02, mine) goes next — it moves no language data, adds one register row (414) and the Generated by Claude Code |
|
Generated by Claude Code |
Slice 2 of #30 (intent: #30 (comment)). Context windows and greedy and seeded text generators are now elaborated by linking:
LM-04..LM-06and the new codeLLT4016. Register: 404 → 407.Draft until certificate A (#157) and certificate B (#163) have landed. This moves the language-1.2 identity. After they land I merge main once, regenerate, and mark this ready once (#15's draft rule).
What it does
context_window(capacity ≥ 1,refuseorkeep_last) elaborates toW.capacity,W.fitandW.pushover the text-laws library. (admitis a reserved name segment, hencefit.) It generates:boundedandpush_bounded: every admitted or pushed context fits;exact: a context that fits is admitted unchanged;suffixunderkeep_last, orrefusesunderrefuse.text_generatornames a prior tokenizer, a prior window, a prior statelesslist uint32 -> list intmodel whose evidence discharges every runtime check, a prioruint32stop token, andmax_tokens≥ 1. It elaborates to:G.score;G.End(stop,exhausted) andG.Failure(unknown_token,context_overflow,invalid_utf8);G.run, the library loop, structural inmax_tokens;G.generateTokensandG.generate.It generates
bounded(at mostmax_tokenstokens) andcontext_bounded(the run equals the run whose scorer is never consulted on a context that does not fit).Policies:
greedytakes the first maximum and no seed.sampleuses the closedxorshift32andproportionalmembers, takes the seed as its last input and returns the next seed.Axiom policies: both declarations gain an
axiomspolicy, astokenizerhas, and the audit holds them to it.Refusals: capacity or
max_tokens0 isLLT4016. A member of the wrong kind isLLT4006.Laws: every law is one
LexLeanTextlemma applied after unfolding, exactly as the tokenizer's laws are. The lemmas are new declarations of the native module, added by the round trip from [v0.4] Add language-model semantic components and compositional text-processing pipeline #30. The second record intests/text-laws/MIGRATION.mdshows the export re-derived from the compiler-generated Lean: 198 declarations and 19,448 nodes, equal except for the decoder'sLeanimport and one hygienic binder name.Text classifiers stay unelaborated; slice 3.
Identity
semantic_ir12 → 13 andlatex_backend12 → 13, and the text library is extended. Every language-1.2 lock, golden, fixture, production export and verification record is regenerated._private.LexLeanText.LexLeanText.#0. It applies to the 21 private names this slice adds as well, and the new derived rows pass feat(core): derived rows are made by Lean's reserved-name actions and checked (SM-33, stage 2 of #91, part 1) #155's remade-row check (LM-04 under Lean).Verified locally (WSL, pinned Lean 4.32.1)
verify-examples(uor-atlas aside, as in slice 1).validate-model,validate-spec-links(407 rows), clippy-D warnings, the workspace tests, the bdd meta-gate,check-test-inventory,check-goldenandcheck-calculus.verify::operational::tests::a_hints_file_from_the_environmentfailed once. It read a garbledLEXLEAN_VERIFY_WIDTH, an environment race with a parallel test. It passed 3/3 alone, and this PR does not touch that file.LM-01..LM-06andLM-13;RP-01..RP-14;AU-04,SM-16,SM-33,PD-01,OR-02,CL-13,RT-04,MD-01andRS-04.LLV7005).Left for later slices
text_rows,rust-std/rust-core),examples/text-modelsend to end, and closing [v0.4] Add language-model semantic components and compositional text-processing pipeline #30.🤖 Generated with Claude Code