Repository navigation
typecheck: track arena_alloc pointer domain to its arena argument - #826
Merged
Merged
Conversation
Contributor
Author
|
Maintenance review after #825 merged: this branch is now one commit behind current |
godofecht
force-pushed
the
feat/690-arena-domain-tracking
branch
2 times, most recently
from
September 5, 2026 19:18
295ad02 to
543b937
Compare
Harvested from completed Jules session 11936246528485187102. Binds the return of arena_alloc(a, size) to a's borrow root so storing an arena pointer in longer-lived storage is rejected as an LD1 domain escape. malloc is unchanged. Flips the old negative test into positive assertions and updates docs/language/lifetime-domains.md. tests/unit/test_lifetime_domains.py: 46 passed. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LARAuTjD3EYMoJq2EeaKpB
Arena tracking marked every local `ptr` binding as function-local storage. That rejected the ordinary case of stashing a heap pointer in a global: `lib/stdlib/gif.flow:239` assigns a `malloc` result held in a local `ptr<u8>` to `gif_block` and stopped compiling. A local counts as function-local storage only when its initializer actually borrows some. `_local_borrow_origin` already answers that, so gate the set on it. A `ptr` holding a `malloc` result has no local origin: its pointee outlives the frame. gif.flow compiles again and the 46 lifetime-domain tests still pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01H7f6FndutYaViuhto1UGA8
godofecht
force-pushed
the
feat/690-arena-domain-tracking
branch
from
September 5, 2026 19:40
543b937 to
e6caad2
Compare
7 of 8 tasks
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.
Progresses #690.
Harvested from completed Jules session 11936246528485187102. The return of
arena_alloc(a, size)carries the borrow root ofa, so storing an arena pointer into longer-lived storage is rejected as an LD1 domain escape.mallocis deliberately unchanged in this increment.Original local validation on the harvested head:
tests/unit/test_lifetime_domains.pypassed 46 tests, including the flipped former-gap test.Current maintenance status (2026-08-31): GitHub currently reports the PR mergeable, but the branch was cut from
d65c3e59…and its validation predates the fixed-point/callback ABI/release-doc changes now onmain.Exact next action: refresh the branch against current
mainlocally and reruntests/unit/test_lifetime_domains.pyplus the bootstrap/fixed-point checks affected by generated compiler changes. Update this PR with the refreshed head SHA and local results before merge. Do not use hosted CI as a substitute.