Repository navigation
perf: emit proven restrict/noalias in C and MLIR backends (#731) - #1344
Merged
Merged
Conversation
godofecht
marked this pull request as ready for review
October 4, 2026 20:20
cursor
Bot
force-pushed
the
cursor/noalias-restrict-731-b0a5
branch
4 times, most recently
from
October 4, 2026 23:09
67c4da8 to
0243d43
Compare
Add a fail-closed provenance certificate for local arrays and constant
slices, then mark only proven-disjoint internal pointer parameters and
unique local pointers with C restrict and MLIR {llvm.noalias}.
Co-authored-by: Abhishek Shivakumar <[email protected]>
cgen calls flowc_noalias_* but the module was missing from frontend_modules, the self-emit plan, roundtrip compile_module, and the g2 fixed-point list. Same inventory pattern as type_id / rt_summary. Co-authored-by: Abhishek Shivakumar <[email protected]>
{llvm.noalias} and // flowc.noalias comments change normalized MLIR
digests. Refresh via parity_mlir.flow --record (also records newly
accepted programs from #1341/#1342 and the noalias fixtures).
Co-authored-by: Abhishek Shivakumar <[email protected]>
cursor
Bot
force-pushed
the
cursor/noalias-restrict-731-b0a5
branch
from
October 5, 2026 00:31
4df442b to
c45b7fe
Compare
Fixed-point C after rebasing onto phase timing (#1343 / c5332d7). bootstrap_from_c.sh --regen (FIXED POINT at gen3) then --verify PASS. Co-authored-by: Abhishek Shivakumar <[email protected]>
flowc now emits // flowc.noalias on proven-local MLIR allocas. Re-record the mlir_commands expected text so the check matches without weakening noalias/restrict emission. Co-authored-by: Abhishek Shivakumar <[email protected]>
8 tasks done
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.
Intent
Linked issue: #731 (parent #727).
First useful slice of proven noalias/restrict emission. Where flowc can already certify that two buffers do not alias, the C backend now writes
restrictand the MLIR backend writes{llvm.noalias}(plus// flowc.noaliason qualifying locals). The analysis is fail-closed: unknown provenance never certifies disjointness.This is the smallest useful change: a shared certificate, backend emission, structural tests, and negative cases. It does not close the whole issue.
Rebased onto current
main(c5332d79, phase timing #1343). Inventory conflicts kept bothnoaliasandprofile. Corpus retarget fromparity_mlir.flow --recordis preserved. Bootstrap C regenerated after the rebase.Overlap check
Overlap / dependency notes:
archive/feat/731-local-restrict.mainincludes feat: profile compiler phases and compile-to-result (#735) #1343 (phase timing /profile), feat: opt-in runtime memory profiler (#740) #1341 (mem profiler), feat: cross-module @rt_safe/@lifetime summaries (#765) #1342 (RT summaries). This branch is rebased onc5332d79.Evidence
Targeted proof after rebase onto #1343:
flowc: PASS(includesprofile_ok=1,type_id_ok=1,rt_summary_ok=1).add_into/pa; none onalias_copy/q../flow tool tests/cgen/run.flow noalias_restrict— PASS../flow test-lang tests/lang/test_noalias_overlap_copy.flow— PASS../flow tool tests/scripts/noalias_mlir.flow— PASS../compiler/scripts/bootstrap_from_c.sh --regen→ FIXED POINT at gen3 (2,700,733 bytes)../compiler/scripts/bootstrap_from_c.sh --verify→ PASS.parity_mlir.flow --recordthenparity_mlir: PASS(23/23 fixtures, 2505 corpus programs). That corpus commit is on this rebase (c45b7fe2).tests/mlir_commands/run.flow --recordformlir_defer_addronly — added// flowc.noalias pyafter the proven-localpyalloca. Check:mlir_commands: pass=1 fail=0for--only mlir_defer_addr. Noalias/restrict emission unchanged.Risk
C/MLIR output changes only when the certificate proves disjointness.
Frontend inventory lists
noaliasnext totype_idandprofilenext toresolve.Corpus and
mlir_commandsretargets use the same--recordpath as feat: stable type identity, schema IDs, and alignof (Part of #775) #1340/feat: opt-in runtime memory profiler (#740) #1341/feat: cross-module @rt_safe/@lifetime summaries (#765) #1342.No unresolved language/API design decision is being implemented implicitly.
No unrelated generated artifacts or local state are included.
Docs changed when user-visible behaviour or syntax changed.
docs/project/Questions.mdupdated if this needs a language-design decision.Compatibility
docs/project/CHANGELOG.md.Remaining gaps (not this slice)
restricton span.datatemporaries (span parameters stay structs)..data, laundering calls, and dynamic slice bounds.Agent handoff
Agent/provider/session: Cursor Cloud Agent.
Any remaining blocker is recorded in GitHub rather than only in local/session state:
c5332d79. New head:76a34cc0cafbbcb409598a96676645628964ddf6. Do not merge until review.