Repository navigation
-mm=own: walk gaps of TSLANG 235; deferred releases; README GPU and own performance - #1135
Merged
Merged
Conversation
…at a local borrow outlives is deferred to the function's exit; README GPU and own performance - copies of walking locals, never-assigned lets given to lending calls, and lets stepped from a lending call's result borrow what the walk borrows; a parameter walked through a copy is not a move - a field given a fresh value while a local still uses its old one: the old value is kept in a function-local temporary and released at the exit (once, no loop, no try); 15 former refusals run as own_deferred_* tests; `this.head = h.next` (the new value part of the old) stays refused - README: GPU kernels section with an example, -mm=own vs Rust/C++ table; TSLANG_ISSUES 247 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…16 GB runner out of memory and it lost contact; rm -rf for the build folder cleanup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
-mm=own: the walk gaps of TSLANG 235
These walks free nothing but were refused. They now compile and print what gc prints:
letthat is never assigned, given to a call that lends it back, inside a loop:let c = this.head; while (..) { const e = nn(c); .. }.while (p) { const e = p; p = e.next; }const e = p!undern > 0 || p !== nullletgiven a lending call's result of a walking local, then stepped:let z = nn(c); z = z!.next.How:
classifyLocalBorrowingLetstakes copies of borrowing locals, through a fixpoint.slotEnds).walksDownOnlypasses through copies, so a parameter walked through a copy is no longer a move.These stay errors: a copy that is stored, or a copy whose list is cut or cleared while it is used (
own_err_walk_copy_stored,_copy_cut,_alias_cut,_lent_copy_cleared).-mm=own: deferred releases (first form)
A field assigned in this function while a local still uses its old value is no longer an error. For example,
let q = a; q = q.next; a.next = null; print(q.i)now compiles. The old value moves into a function-local temporary, which is released at the function's exit (deferrableRelease/applyDeferredReleases).The deferral applies only when all of these hold:
ReleaseSlot+Storeinto aPropertyRef.null, a literal,new C(), or a local only ever given one.The fresh-value rule matters. With
this.head = h.next, the new value is part of the old one: the exit's release would free it, and own moves it out of the old value, so a laterh.nextread null. A probe caught this (it printed 10 where gc prints 12), so that shape stays refused (own_err_list_pop_used_after).A cut on every turn of a loop also stays refused (
own_err_deferred_release_in_loop,own_err_walk_const_head_cut). Where the TSLANG 219 count already applies, the count is used.Former errors now accepted. This is wider than list walks. 15 tests that were refusals are now
own/own_deferred_*.tsrun tests, under the rule asked for: a release in the same function that conflicts with a live local borrow is deferred. They include:field_alias,union_moved,read_after_move_overwritten);borrowed_result_outlives,lends_outlives,borrowed_result_holder_stored);borrowing_record_place_overwritten,borrowing_array_field_reset);merge_read_overwritten,split_let_field_overwritten);fill_after_fill_call,list_lookahead_cut,weakref_after_release,moved_param_field_dropped,walk_lent_copy_cleared.Each test was rewritten so its
mainreaches the assignment, allocates after it, reads afterwards and loops 1000 times. Each prints what gc prints.own_err_walk_lent_copy_clearedstays as a refusal guard, now clearing through a call, which is not deferred.Other test changes
00tslang_issue_235_own_gaps.tsand00tslang_issue_235_own_deferred.tsrun under gc, rc, none and own.own_err_result_borrows_argumentis accepted now:ptstakes its own reference (TSLANG 219, USER RULING 11-27). It is renamedown_counted_result_borrows_argument.own_err_list_cut_through_aliasis still refused; the error is now reported at the use after the cut.Docs
@kernel/gpuLaunchexample, and a table comparing-mm=ownwith Rust and C++.e4_overwriteexample was already accepted by the TSLANG 219 count.CI (Linux)
The Ubuntu "debug programs, exe" leg periodically failed with "The hosted runner lost communication with the server" during the Build step. The cause was
-j 8on a 4-core, 16 GB runner: eight compiles of the MLIR sources at once ran it out of memory.The fix:
-j 4, as create-release.yml already builds;rm -rffor the build-folder cleanup. Its error on a fresh runner was harmless (continue-on-error) but looked like the failure.Verification
--deep(250 programs) and--classes(250 programs) give 0 failures, on top of an earlier--deeprun of 300.awaitbetween the cut and the use, as an exe;anyfields;yieldis refused, as before.🤖 Generated with Claude Code