Skip to content

Sema: the retention window — a callable retained as callback userdata is a live view while its resource is used (§16.2b.9) - #1696

Merged
ehartford merged 1 commit into
mainfrom
pairs-retention-window
Sep 26, 2026
Merged

ehartford merged 1 commit into
mainfrom
pairs-retention-window

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Follow-up to #1679 under Eric's ruling (D66 amendment, #1692): a local handed to a pair's userdata setter stays a live view for as long as the retaining resource is used, so a read of the sink between the setter and run/perform is refused by #1694's check (fixture: err_c_facade_variadic_callback_sink_read_in_window.w); the check-only shapes fixture now reads the sink after the run. Runtime libcurl fixtures unchanged. Draft until the battery is green.

…e its resource is used (§16.2b.9 retention window, #1652 follow-up)

Eric's ruling: the retained userdata is the callable's own mutating view
of its captured places, held by the resource until reset, destruction or
its last callback-capable operation, so the sink cannot be touched inside
that window. Sema now records, at a pair userdata setter call with plain
locals on both sides, that the resource retains the callable; the three
view-liveness paths (the read check, the mutation check, the statement-end
sweep) treat a use of the resource as a use of the view. Reading the sink
between the setter and the run is refused by #1691's check; after the
run it is ordinary.
@ehartford

Copy link
Copy Markdown
Contributor Author

Seed-driven battery at 0b55abc (seed nightly-20260925-local-1, WITH=src/main), this host:

0b55abc4 Sema: a callable retained as callback userdata stays a live view while its resource is used (§16.2b.9 retention window, #1652 follow-up)
pairswindow build rc=0
pairswindow :fixpoint rc=0
pairswindow :drop-audit rc=0
pairswindow :move-audit rc=0
pairswindow :test rc=0
pairswindow :test-green rc=0
pairswindow :last-green rc=0
pairswindow :user-programs-safe rc=0
BATTERY_DONE

@ehartford
ehartford marked this pull request as ready for review September 26, 2026 02:15
@ehartford
ehartford merged commit c170aab into main Sep 26, 2026
@ehartford
ehartford deleted the pairs-retention-window branch September 26, 2026 03:18
@ehartford ehartford mentioned this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant