openspec: add codegen-ir-correctness-and-gate change proposal#14
Merged
Hyper66666 merged 1 commit intoJun 10, 2026
Merged
Conversation
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Planning-only OpenSpec proposal (no code changes). It re-plans the next step toward a mainstream-usable Sengoo after
core-language-correctness(PR #13) was merged and CI went green.Why: building the toolchain and exercising the real
sgcCLI on the toolchain this repo pins for developers (clang-14) shows the "done" core forms still fail to compile. The previous gate is green only because it compiles through the in-crate#[cfg(test)] compile_source()helper and runs under CI'sclang-19.Reproduced on
clang 14.0.0/rustc 1.94.0(the pinnedrust-toolchain.toml):sgc run examples/04_array.sg'%u_4' defined with type '[3 x i64]*' but expected 'i64*'sgc run examples/05_loop.sg,conformance/03_array_write.sgsgc run examples/06_lambda.sg,conformance/04_closure_multi_capture.sg'%u_5' defined with type '[1 x i64]*' but expected 'i64*'-> EnumType@gettyped{ i64, [8 x i8] }(i64)*but call site expectsi64(i64)*Variant(b) => ...followed by any armparse error: invalid pattern: expected identifiercargo test -p sgc core_conformance_examples_compile_link_and_runRoot cause: codegen states pointer operand types that disagree with the value's defined type, e.g.
Typed-pointer LLVM (
clang <= 14) rejects this; opaque-pointer LLVM (clang >= 15, every pointer isptr) drops the pointee type so the mismatch disappears and the address still computes correctly. CI usesclang-19, so it never sees the error. Separately, the match-arm parser only terminates aVariant(bindings)pattern correctly when it is the last arm; every committed conformance example places its single payload arm last, hiding the defect.What the proposal owns
sgcCLI (sgc build/sgc run), not the in-crate helper, and add the two forms the old gate could not catch (multi-payload match, enum-returning fn).clangcontract: CI and the developer blueprint share one major version;sgcreports a clear error below contract instead of a raw IR verifier error.This is a correctness/gate-integrity change; it explicitly does not add traits/Option-Result/
as-casts/generic collections (those are separate proposed directions). For fairness,let mut, immutable-assignment rejection, and match exhaustiveness fromcore-language-correctnesswere independently verified as genuinely working.Contents (
openspec/changes/codegen-ir-correctness-and-gate/):proposal.md,design.md(reproductions + root cause + two acceptable pointer-model fixes),tasks.md(7 phases + archive gate),specs/.../spec.md(4 ADDED requirements, WHEN/THEN scenarios).openspec validate codegen-ir-correctness-and-gate --strictpasses (CLI@fission-ai/openspec 1.4.1).Link to Devin session: https://app.devin.ai/sessions/01c0d55188c64bef8f68fbe3c905738f
Requested by: @Hyper66666