Repository navigation
[Flow 2.0] Implement local region inference and automated non-aliasing proofs - #1390
Conversation
…g proofs Part of epic #679. Closes #694. This commit completes the implementation of constraint-based local region inference to prove disjoint memory regions automatically, eliminating unnecessary aliasing barriers. It also provides clear diagnostics when aliasing cannot be proven safe and drops back to an unproven region (fail-closed answer). Builds upon and supersedes cursor/region-inference-694-316b. Co-authored-by: godofecht <[email protected]>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…g proofs Part of epic #679. Closes #694. This commit completes the implementation of constraint-based local region inference to prove disjoint memory regions automatically, eliminating unnecessary aliasing barriers. It also provides clear diagnostics when aliasing cannot be proven safe and drops back to an unproven region (fail-closed answer). Builds upon and supersedes cursor/region-inference-694-316b. Co-authored-by: godofecht <[email protected]>
roundtrip2.txt and roundtrip_output.txt are logs of a roundtrip run that were committed by accident in #1390. Nothing references them.
…om closed PRs Salvaged from closed pull requests whose code already landed: - #1360 (region inference, code merged as #1390): region-inference.md, the tests/cgen region_inference and region_unproven goldens, and the spec, book, spans, lifetime-domains, README, spec-index, nav and CHANGELOG lines. - #1368 (noalias, code merged as #1388): the spans.md paragraph on restrict .data temporaries and its noalias.md link. - #1380 (tail-resumptive effects, code merged as #1349): the spec-index row for effects-continuations.md. #1417 landed after #1360 and keeps an unproven forward copy as an ordered element loop. The region_inference golden and the docs now say that, in place of the memmove the closed branch expected. The golden fails on the pre-#1417 compiler, which emitted memmove.
The lattice is callback < frame < request < session < application < persistent, as accepted on 2026-10-07 (docs/project/Questions.md). LD1-LD4 apply to both. request may allocate and is not @rt_safe. persistent is the outermost domain: an application pointer may not be stored in a persistent static, and an @Lifetime(application) function may not call a persistent one. Compact summaries encode unannotated callables as domain rank 6. Rebased from PR #1369 onto current main; doc conflicts with region inference (#1390) and the arena-domain rows (#690) kept both sides. Whether persistent values must be TransportSafe is #1421. The #690 arena-domain check hard-coded application as 3, which is session once request is inserted; it now uses FLOWC_RT_DOM_APPLICATION (domain_arena_ok_unannotated failed without this).
The lattice is callback < frame < request < session < application < persistent, as accepted on 2026-10-07 (docs/project/Questions.md). LD1-LD4 apply to both. request may allocate and is not @rt_safe. persistent is the outermost domain: an application pointer may not be stored in a persistent static, and an @Lifetime(application) function may not call a persistent one. Compact summaries encode unannotated callables as domain rank 6. Rebased from PR #1369 onto current main; doc conflicts with region inference (#1390) and the arena-domain rows (#690) kept both sides. Whether persistent values must be TransportSafe is #1421. The #690 arena-domain check hard-coded application as 3, which is session once request is inserted; it now uses FLOWC_RT_DOM_APPLICATION (domain_arena_ok_unannotated failed without this).
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
The lattice is callback < frame < request < session < application < persistent, as accepted on 2026-10-07 (docs/project/Questions.md). LD1-LD4 apply to both. request may allocate and is not @rt_safe. persistent is the outermost domain: an application pointer may not be stored in a persistent static, and an @Lifetime(application) function may not call a persistent one. Compact summaries encode unannotated callables as domain rank 6. Rebased from PR #1369 onto current main; doc conflicts with region inference (#1390) and the arena-domain rows (#690) kept both sides. Whether persistent values must be TransportSafe is #1421. The #690 arena-domain check hard-coded application as 3, which is session once request is inserted; it now uses FLOWC_RT_DOM_APPLICATION (domain_arena_ok_unannotated failed without this).
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
… declaration (#732) Pointer-ABI sret applied to the definition while the bodyless forward declaration kept the value-return prototype and call sites resolved the first node of the name. compiler/src/region.flow (#1390) has such declarations, so roundtrip's compile_module region failed with conflicting types. A name shared by a forward declaration or an overload keeps the plain C signature. roundtrip's stage_a_infer_struct check accepts the sret form of the typed let.
Part of epic #679.
Closes #694.
This commit completes the implementation of constraint-based local region inference to prove disjoint memory regions automatically, eliminating unnecessary aliasing barriers. It also provides clear diagnostics when aliasing cannot be proven safe and drops back to an unproven region (fail-closed answer).
Builds upon and supersedes cursor/region-inference-694-316b.
PR created automatically by Jules for task 417636611563615652 started by @godofecht