Skip to content

#2977, #3052 (D195), #2636, #2978: concurrency evidence by reach, @[suspends], CK_ZEROED, a pin - #3064

Merged
ehartford merged 2 commits into
mainfrom
weekend-compiler-fixes
Nov 7, 2026
Merged

ehartford merged 2 commits into
mainfrom
weekend-compiler-fixes

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Four compiler defects from the weekend list, each located to its line and pinned.

Issue Root cause Fix Fixture
#2977 an .await in an unused std body race-checks every importer record_global_concurrency_evidence set one program-wide flag from wherever it was called: the "async function call" inside pause's body (SemaCheck.w, the four task_fns sites) counted though nothing calls pause. Evidence is kept with the function it was found in; every resolved call (note_call_resolution, the one door into comp_resolved) and every function taken as a value is an edge; resolve_global_race_concurrency walks the edges from the roots (top level, the program's own modules, trait impl methods) once all bodies are checked, and the proof fails only on evidence the program reaches. The first counted site labels the E0921. behav_2977_unused_async_import_keeps_single_thread_proof.w with lib/lazy_async_sleeper.w
#3052 method_may_suspend_current_fiber is a hand list of std names A per-stage name table for a declaration's fact (D65, D110). D195 (delegated): @[suspends] on the declaration (FnFlags.SUSPENDS, suspending_fns), written on the eleven std methods in lib/std/sync.w; the compiler-declared builtins (Sender.send, Receiver.recv, Task.join_cleanup) carry the fact where Sema.w interns their names (builtin_suspending_methods). §14.3 says so; changelog v7.40. The flag took the last free bit, so FN_META_REQUIRED_UNIT moves to 131072. err_3052_suspends_attribute_in_no_suspend.w (a program's own @[suspends] method inside no_suspend is E0702)
#2636 audit:all fails on hello world under a :dev stage1 T.zeroed() lowered to const zst(T), the same rvalue as the reset-on-move blank, so validate_use_after_kill read let it = T.zeroed(); return it in the in-unit stc corpus as a read after a kill, and the drop-state tracker read the value as Reset. ConstKind.CK_ZEROED: the all-zero value, materialized as the blank is (both backends), never read as one. behav_2636_zeroed_value_read_back.w; with-stage1 analyze main.w audit:all is clean
#2978 D184 comprehension over a map global lowered a pointer Already fixed on main by the D184 landing (the repro prints [2] under the installed compiler). Pinned. behav_2978_script_map_comprehension.w

Boy-scouting in the functions touched (Eric, 2026-11-07): lists are [], loops iterate the list, no inferable annotations.

…uspends], CK_ZEROED, a pin

#2977: concurrency evidence is kept with the function it was found in and
counts only where the program reaches it: every resolved call
(note_call_resolution) and function value is an edge; the roots are top
level, main, entry/test/bench/panic handlers, @[c_export] and trait impl
methods. A library body nothing calls no longer makes the program
concurrent. #3052 (D195, delegated): a method's may-suspend fact is its
declaration's — `@[suspends]` (FnFlags.SUSPENDS, the std lock/wait
methods in lib/std/sync.w) or the compiler's own declaration of a builtin
(Sender.send, Receiver.recv, Task.join_cleanup) — and the hand list in
method_may_suspend_current_fiber is gone; §14.3, changelog v7.40.
#2636: `T.zeroed()` lowers to its own constant (CK_ZEROED), not the
reset-on-move blank, so the use-after-kill validator and the drop-state
tracker read it as a value; `audit:all` on hello world is clean under a
:dev stage1. #2978: already fixed on main; pinned.
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