Repository navigation
compiler: add the t27 IR v1 spec - #13518
Merged
Merged
Conversation
Add the t27 IR v1 spec.
This was referenced Nov 9, 2026
Contributor
This was referenced Nov 9, 2026
This was referenced Nov 9, 2026
Co-authored-by: Dmitrii Vasilev <gHashTag@users.noreply.github.com>
This was referenced Nov 15, 2026
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.
Summary
specs/compiler/ir/t27_ir_v1.t27.Test plan
t27c parse specs/compiler/ir/t27_ir_v1.t27Note
Low Risk
Documentation and self-contained spec tests only; no t27b or pipeline integration, so runtime compiler risk is minimal.
Overview
Introduces
specs/compiler/ir/t27_ir_v1.t27, a new versioned t27_ir_v1 interchange contract: prose plus machine-checkable status constants that distinguish what exists today (internal t27b IR, t27c emitters) from planned work (foreign frontends, binary IR, t27b reader).The file also ships a minimal executable slice of that contract: canonical textual IR for a single
i32add-style function,validate()with stable diagnostic codes (version, structural, forbidden C-subset tokens such asptr/goto), deterministic serialization with sorted locals, and SHA-256 over canonical bytes—explicitly without wiringt27b. Extensive tests lock “no overstated claims” (frontends absent,T27B_READS_T27_IR_V1 == 0, benchmarks unmeasured) and canonical/hash behaviour.Reviewed by Cursor Bugbot for commit 26d1234. Bugbot is set up for automated code reviews on this repo. Configure here.