Repository navigation
[codex] SG-1 debt cleanup: structural token rows - #566
Conversation
|
ChatGPT review in progress... (view conversation) Check back in ~30 minutes for the full review. |
briansrls
left a comment
There was a problem hiding this comment.
codex · gpt-5.4 · 0c430b5f
BLOCKING (1)
Root Cause
src/v3/compiler/tokenize.dagThe row schema needs a first-class fixed-token/nullary-constructor carrier (or a documented scaffold with a named dissolution trigger); reusing full TokenKind leaves regen_tokenize and the test suite to re-impose the invariant after lowering.
Non-blocking — Strengths
src/v3/compiler/src/bin/regen_tokenize.rsDeriving punctuation width from pattern removes the second authority instead of validating a redundant width field at codegen time.src/v3/compiler/tests/integration/sg1_tokenize_authority_test.rsThe new SG-1 authority test is a useful ratchet against kind_name and width drifting back into the row schema.
| type KeywordSpec { | ||
| spelling: String | ||
| kind_name: String | ||
| kind: TokenKind |
There was a problem hiding this comment.
BLOCKING: KeywordSpec.kind and PunctSpec.kind use the full TokenKind, so SG-1 rows can still encode nonsensical authorities like Eof (and payload-bearing variants are only rejected later by panic), which violates illegal-states-unrepresentable and API-level enforcement at the substrate boundary.
|
BLOCKING (1) Root Cause
Non-blocking — Strengths
|
ChatGPT ReviewGenerated by gpt-5-4-pro I have reviewed the materials, including the code diff and relevant documentation. Here's the analysis for the PR #566 review: Findings:
Deepest Question (optional):
Verdict:APPROVE — The changes appear to be clean, following the established modeling principles. No structural issues were found in the diff. If you need any further clarification or have specific parts of the code you'd like to discuss, feel free to let me know! |
|
claude-review (director) — ✅ LGTM substantively. Strong execution of Validated against original intent:
Structural wins packed cleanly:
Coordination — stacked on #556: This PR is stacked on #556 SG-1 per the description. Land order matters:
Next steps:
Push to convergence. No structural concerns. This is exactly the |
|
ChatGPT review in progress... (view conversation) Check back in ~30 minutes for the full review. |
* WIP: SG-1 * WIP: SG-1 * chore: apply cargo fmt * WIP: SG-1 * chore: apply cargo fmt * WIP: SG-1 * WIP: SG-1 * chore: apply cargo fmt * WIP: SG-1 * WIP: SG-1 * chore: apply cargo fmt * WIP: SG-1 * chore: apply cargo fmt * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * chore: apply cargo fmt * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * chore: apply cargo fmt * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * WIP: SG-1 * [codex] SG-1 debt cleanup: structural token rows (#566) * WIP: Debt * chore: apply cargo fmt * Tighten SG-1 token row carriers * chore: apply cargo fmt * WIP: SG-1 * WIP: SG-1 * fix(regen_tokenize): use slice::contains to satisfy clippy::manual-contains
What changed
This stacked PR pays down the remaining SG-1 row-schema debt on top of
#556.KeywordSpec.kind_name: StringwithKeywordSpec.kind: TokenKindPunctSpec { pattern, width, kind_name }withPunctSpec { pattern, kind }regen_tokenizeto read structural nullaryTokenKindvariants from the lowered Dag instead of validating string labels at runtimepatternbytes during codegen instead of storing a second authority fieldkind_name/widthcannot drift back inWhy
tokenize.dagwas still carrying semantic facts by convention:kind_nameduplicatedTokenKindvariant identity as a stringwidthduplicated information already present inpatternThe substrate can already carry nullary sum constructors structurally, so this PR removes both duplicate facts instead of banking them as ongoing debt.
Impact
This is a schema-tightening cleanup only. The generated tokenizer behavior stays the same; the change is that SG-1 authority rows now encode the facts structurally and
regen_tokenizeprojects from that shape directly.Validation
cargo run -q -p v3-compiler --bin regen_tokenizecargo test -p v3-compiler --test integration sg1_tokenize_authority_test -- --nocaptureNotes
session/neat-pike-779/ PR#556