Specializer M-interp: closure-compiled IR interpreter (the oracle backend) - #25
Merged
ahrzb merged 3 commits intoJul 25, 2026
Conversation
…terp) src/specializer/exec/: runtime substrate (Batch, byte-backed bump Arena with StrRef spans, sorted-vec map statics probed by allocation-free binary search) + interp.rs (compile verifies first — nothing executes unverified IR — then one pre-traversal builds per-block closures; terminators are a small enum in the row loop; branch-arg copies are safe by SSA disjointness). Steady state allocates nothing: registers/arena/out builders live in a reusable RunState; a thread-local counting global allocator asserts zero allocs on a warmed run. Semantics pins documented in interp.rs (checked integer arithmetic, IEEE floats, half-away-from-zero ftoi.round, exact-parse stoi/stof) — provisional until the DuckDB differential at M-lower. All five M-ir fixtures execute against hand-computed expectations incl. the trap path; 150-seed generated programs execute deterministically. TASK-42. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… — TASK-42 Six agents (4 attack lenses + 2 reviews) probed the oracle; confirmed findings fixed and pinned: - StrRef offsets widened u32 -> usize: a single call legitimately exceeding 4 GiB of varlen data silently aliased old spans (Ok with corrupt output — the one thing an oracle must never do) - store.opt with a false flag now stores the type-default payload the spec pins, not the live register - check_input validates the validity lane of nullable columns (a short valid vec silently meant "all valid") - register slots assigned densely at compile: sparse-but-legal value ids can no longer inflate the frame (Value(u32::MAX) demanded a 64 GiB vec) - zero-allocation claim restated honestly: warmth is per content profile (branch paths, probe hits, non-NULL varlen), growth one-time + monotone — refuted-as-written by branch/probe/validity flips at identical shape - RunState.emitted reports the row count (observable with 0 out columns) - Ctx made private; out_decl drops its unread nullable flag; probe hit arm zips entry values directly - semantics pins now all tested: overflow/div traps incl. irem MIN%-1, fcmp NaN table, ftoi ties + range traps, IEEE inf/nan flow, scmp order, exact stoi parse, load.opt garbage normalization cargo 65 passed; gate green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…notes Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ahrzb
merged commit Jul 25, 2026
590b820
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-42, milestone m-7 — stacked on #23, follows merged #24)
The interpreter backend over the M-ir IR, per design doc §7:
exec/mod.rs— runtime substrate: columnarBatch, byte-backed bumpArena(StrRefspans;extend_from_withinmakessconcatallocation-free), map statics as sorted vecs probed by allocation-free binary search (perfect hashing stays the codegen backend's game), reusableRunState.exec/interp.rs—compile()verifies first (unverified IR is uncompilable), then one pre-traversal builds per-block closure vectors; terminators are a small enum in the row loop. Boundary checks trap (not panic) on input-shape and foreign-RunStatemismatches.idiv/iremtrap on 0 and MIN/-1, IEEE floats,fcmpIEEE-ordered,ftoi.roundhalf-away-from-zero, exact-parsestoi/stof.Verification
|out| <= |in|, byte-identical reruns)mise gate-specializergreen: cargo 55 passed, pytest 574 passed + 12 xfailed🤖 Generated with Claude Code