Conversation
…ean.t27 Builds the same Lean text byte for byte into caller buffers: var_names, nest_mac, plus/minus/cancellation chains, zero_weight_closure, theorem_block, and main's appended text (w384_appendix) plus its idempotence check. main keeps an undefined body (file I/O). Expected values come from the Python original. Closes #6080 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 5, 2026
Merged
Contributor
This was referenced Oct 5, 2026
duplicate-bodies flagged the test helper as a copy of gen_w367.t27's slices_equal. Tests now compare with std.mem.eql; any non-test use is folded into the loop that needed it. Criteria and negative control re-run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR DashboardGenerated at: 2026-10-05 16:24:18 UTC
Summary
Seal Status
|
This was referenced Oct 5, 2026
Owner
Author
|
Superseded by #6555: the same final spec in a single commit that carries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6080
Ports
scripts/gen_w384_lean.pytospecs/port/scripts/gen_w384_lean.t27. One file,.t27only.Design
The original builds Lean theorem text. t27 has no string concatenation or f-strings. Rather than reduce the text to integer stand-ins, this port builds the same text byte for byte into byte buffers that the caller supplies. A function that returned
strwrites intobufatposand returns the end position. A function that returned(str, str)writes into two buffers and returns both lengths.var_names(n, sep, buf, pos)writes the first n names joined bysep, skipping the Lean keywords in the original's skip set. Every caller of the Pythonlist[str]either joins it or walks it, so activations are carried as name ordinals.nest_mac,plus_chain,minus_chain,cancellation_chain,zero_weight_closureandtheorem_blockare ported in full.main()keeps anundefined;body that no test calls, because it does file I/O and prints. Its two decisions are ported and tested:already_present, the idempotence check;w384_appendix, the exact text main appends ("\n\n" + "\n\n".join(blocks) + "\n").put_forallwrites the UTF-8 bytesE2 88 80.Every expected value in the tests was printed by running the Python original:
Acceptance criteria
These were run on the Railway t27c lab, with t27c built from origin/master e7afb32.
gen-rustandgen-calso succeed.coveragelists 22 functions with 17 tested directly. The other 5 aremain, which is plumbing, and four byte writers that the string-equality tests exercise.Negative control. I changed three expected values (the appendix hash,
"a + b"to"a+b", and the 62-name length from 159 to 160).test-reportthen printedpass 9, FAIL 3, naming exactly those tests.Follow-up commit c1fc168. duplicate-bodies flagged the local
bytes_eqas a copy ofgen_w367.t27'sslices_equal. The tests now usestd.mem.eql, andcontainscompares bytes inline. The criteria above and the negative control were re-run after that change.🤖 Generated with Claude Code