Specializer M-ir: imperative IR — grammar, types, verifier, text format - #24
Merged
claude-agent-ahrzb[bot] merged 3 commits intoJul 25, 2026
Conversation
… (M-ir) src/specializer/ir/: SSA over bare typed scalars with the null lane split into explicit i1 flags (.opt instruction forms) so a nullable value cannot reach arithmetic by construction; strict block-param SSA (no dominance analysis needed); acyclic CFG; emit/skip/trap terminators carrying the store-completeness contract (|out|==|in| iff skip unreachable). verify.rs enforces six rule groups, each with a rejecting test; print/parse round-trip exactly (parse(print(p)) == p, bitwise literal equality so nan/-0.0 survive); gen.rs is a seeded xorshift program generator — 300-seed round-trip fuzz in tests, reused later for interpreter-vs-codegen fuzzing. Design doc §6 updated to the implemented form. TASK-41. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… — TASK-41 Six agents (4 attack lenses + 2 reviews) probed the initial IR; every confirmed finding is fixed and pinned by a regression test: - reachability DFS made iterative: a ~8k-block legal CFG stack-overflowed the process; 50k blocks now verify (deep_cfg_verifies_without_crashing) - verified programs must print to parseable text: reject empty map static signatures (grammar can't express `map() -> ()`) and non-identifier function names - Lit::F64 equality treats all NaNs as one class, matching the text form's canonical `nan` token — non-canonical payloads round-trip again - store dataflow runs over the reachable subgraph: an unreachable cyclic island no longer starves a reachable join and masks its store errors - docs aligned: double stores rejected on ALL paths incl. trap (deliberate), grammar EBNF covers store/comments/lenient %names, canonical-form note - dead Inst::uses/Term::uses deleted; 7 missing rule-coverage tests added (entry params, duplicate cols, branch-to-entry, sload-on-map, scalar-static .opt pairing both ways, store.opt on non-nullable) cargo 45 passed; gate green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…notes Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
claude-agent-ahrzb
Bot
merged commit Jul 25, 2026
b6b93e4
into
claude/duckdb-native-interpreter-36d016
1 check passed
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.
What (TASK-41, milestone m-7 — stacked on #23)
The specializer's imperative IR, per design doc §6 (updated in this PR to the implemented form):
src/specializer/ir/mod.rs— the normative spec in module docs + core types. SSA over bare scalars (i1/i64/f64/str); nullability exists only at column/static edges via.optinstruction forms, so a nullable value cannot reach arithmetic by construction.verify.rs— six rule groups (structure, SSA w/ strict block-param crossing, operand types + mandatory/forbidden.optpairing, static resolution, CFG reachability/acyclicity/branch-arg typing, store-completeness dataflow). No dominance analysis needed by design.print.rs/parse.rs— canonical round-trippable text format:parse(print(p)) == p, bitwise literal equality (NaN/-0.0 survive), quoted column names for SQL-derived output columns.gen.rs— seeded xorshift program generator; 300-seed round-trip fuzz in CI-run tests; reused at M-interp for interpreter-vs-codegen fuzzing.fixtures.rs— five hand-written programs; a meta-test asserts every opcode/terminator appears in at least one.Verification
mise gate-specializergreen: cargo 33 passed, pytest 574 passed + 12 xfailed🤖 Generated with Claude Code