Repository navigation
feat: remaining @rt_safe/@lifetime summary gaps (#765) - #1355
Merged
Merged
Conversation
godofecht
marked this pull request as draft
October 7, 2026 07:58
This was referenced Oct 7, 2026
godofecht
force-pushed
the
cursor/rt-safe-summaries-remaining-af06
branch
from
October 8, 2026 00:52
1715534 to
38cea54
Compare
godofecht
marked this pull request as ready for review
October 8, 2026 00:52
godofecht
enabled auto-merge
October 8, 2026 09:01
…#765) Close the remaining #765 gaps on top of the landed first slice: a known-safe extern allow-list so unknown is a hard error from @rt_safe, impl methods in the call graph (closures stay with #766 / PR #1348), LD1 through static fields and malloc stores, and a refinement-keyed incremental summary cache. Co-authored-by: Abhishek Shivakumar <[email protected]>
Co-authored-by: Abhishek Shivakumar <[email protected]>
Co-authored-by: Abhishek Shivakumar <[email protected]>
The summary cache let a stored snapshot under ~/.cache/flow/rt skip the Stage-A RT consult. A writable cache file could switch off RT checks, and the key had no compiler or schema salt. That is a trust decision, recorded in docs/project/Questions.md. The refinement relation stays as a tested pure function; the cache I/O, the typecheck probe and save, and the selftest's fixed /tmp path are removed.
godofecht
force-pushed
the
cursor/rt-safe-summaries-remaining-af06
branch
from
October 8, 2026 10:28
38cea54 to
52e823c
Compare
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
Closes #765 (remaining slice after #1342).
#1342 landed emit and import of compact
$fnamesummaries and their use during type checking. This slice closes the gaps that PR listed:@rt_safe/@lifetime(callback)reject anunknowneffect summary unless the extern is on a known-safe allow-list (math, atomics, bounded copies, numeric conversions, print). Diagnostics say "unknown effect summary" and keep the call chain.implmethods join the RT call graph. An ambiguous trait method stays a conservative reject.malloc/alloc_*result (or a cast of one), as a store into theapplicationdomain.flowc_rt_refines,flowc_rt_summaries_refine, framing validation, fingerprint) is implemented and covered by the selftest. Empty, truncated or malformed snapshots never count as refined.Not included: the persistent RT summary cache
The earlier version of this branch stored summary snapshots under
~/.cache/flow/rtand skipped the Stage-A RT consult on a cache hit. That lets a writable cache file switch off RT checks, the key had no compiler or schema salt, and the selftest wrote to a fixed/tmppath. It is a trust decision, so commit c5d997a removes the cache I/O and the typecheck probe/save, and docs/project/Questions.md ("RT summary cache: may a stored snapshot skip RT checks?") records the options. The original commits stay in the history.Rebase
Rebased onto main 55dc81b as a linear series (the two merge commits were dropped; their resolutions were bootstrap-only). Per-hunk resolutions:
Evidence
On this head (macOS arm64):
flowc: PASS,rt_summary_n=57 helper_bits=1 process_bits=1 tick_dom=0 ok=1--verifyALL PASS./flow test --tier2 --strict991/991Risk
Compatibility: an
@rt_safefunction that calls an unclassifiedexternnow fails. Documented in CHANGELOG.Remaining gaps outside #765's stated scope: closures and HOF
with rt_safe(#766, in the #1348 train), escape through a call, pointer laundering.