Skip to content

D110: builtin parameter modes come from signatures, once - #2274

Merged
ehartford merged 5 commits into
census-lanefrom
sig-modes
Oct 8, 2026
Merged

ehartford merged 5 commits into
census-lanefrom
sig-modes

Conversation

@ehartford

@ehartford ehartford commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

D110: builtin parameter modes come from signatures, once.

  • src/BuiltinSigs.w declares each builtin's signature with its parameter modes. Sema loads the table once, resolves the row when it checks the call and stores it on the call node; MIR and codegen read that row. No lookup on the hot path.
  • Deleted: method_arg_consumes_key (SemaCheck), the MAP_GET or MAP_CONTAINS or MAP_REMOVE observer test (MirLower), the per-intrinsic key-drop decisions (CodegenDispatch). A builtin has no second ownership system.
  • Fixed while there: increment leaked its key; join/expect blanked their argument; Vec.join over non-str elements read garbage (now refused). Added Vec.sort/Vec.swap (heapsort, elements move by swap) and it in f-string holes (§9.3.1).
  • The Migrator: a function-like macro's translation depends on earlier macro lookups (cache side effect) #2265 tests that asserted "use of moved key" for str keys now assert the key stays live (behav_2265_*_key_stays_live).

Eric Hartford added 5 commits October 8, 2026 08:53
The tree hand-rolled sorting at least seven times (O(n^2), allocating per
insert) because Vec had no sort. Heapsort in place; elements move by swap,
never by copy (2.3).
The hole's sub-parser saw `it` and dropped the fact; map(f"{it}") failed
with an undefined __it.
A Vec[i32] was accepted and read each pair of ints as a str's {ptr, len}:
it printed nothing, or crashed in memcpy.
@ehartford
ehartford added this pull request to stack #2278 October 8, 2026 22:07
@ehartford ehartford changed the title sig modes D110: builtin parameter modes come from signatures, once Oct 8, 2026
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on the stack top 42c8b5a (seed-driven, with run tools/battery.w): gate rc=0 761 s, uat rc=0 30 s, battery-checks rc=0 858 s (fixpoint, drop and move audits, every test target). Logs: out/battery/ in the str-sweep worktree.

@ehartford
ehartford marked this pull request as ready for review October 8, 2026 23:37
@ehartford
ehartford merged commit f5c73f8 into main Oct 8, 2026
@ehartford
ehartford deleted the sig-modes branch October 8, 2026 23:38
ehartford pushed a commit that referenced this pull request Oct 9, 2026
Sorting comes from the migrated corpora (docs/proposals/
stdlib_sourcing_plan.md, D37): STC's algorithm layer, migrated whole and
exposed through the std.algorithms facade in Phase 3, which closes #940.
libstd-spec §1.2: "Nothing native is written for this section." The
heapsort added in #2274 was the native rewrite the ruling rejects, under
public names no spec text defines (and unstable, which Python's and
Rust's `sort` are not). Nothing outside its own test called it.
ehartford added a commit that referenced this pull request Oct 9, 2026
Sorting comes from the migrated corpora (docs/proposals/
stdlib_sourcing_plan.md, D37): STC's algorithm layer, migrated whole and
exposed through the std.algorithms facade in Phase 3, which closes #940.
libstd-spec §1.2: "Nothing native is written for this section." The
heapsort added in #2274 was the native rewrite the ruling rejects, under
public names no spec text defines (and unstable, which Python's and
Rust's `sort` are not). Nothing outside its own test called it.

Co-authored-by: Eric Hartford <[email protected]>
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