Repository navigation
The src/ extern sweep: compiler modules reach the runtime and libc through imports; the machine's information is a record - #2621
Merged
Conversation
…es the runtime and libc through imports, never an agreeing duplicate extern; the machine's information is a record
The last 31 duplicate declarations in src/ (str_from_byte and i64_to_string beside the rt.rt_core import that already had them; abort, exit, strerror, strtod now `use std.libc.*`; rt_read/rt_write/rt_close/rt_seek/rt_getcwd now `use rt.platform`, in ComptimeEval, FrameworkStubs, Runtime, LlvmBridge and ClangBridge) are gone. What the duplicates hid: `exit` declared as returning left a dead `return` after it (main.w); three `unsafe` blocks wrapped libc calls that are safe by declaration (R4c); ClangBridge spelled strtod over `*const u8` where libc says `*const c_char`. The `wl_*`/`clang_*` bridge entries and the tool mains stay extern: they are C symbols of our own bridge objects. rt_core declares `SysInfo { cpu_cores, memory_total, page_size }` once and `with_system_info() -> SysInfo`; std.sys reads the record. The byte form `with_sysinfo(out)` and the record copies in BuildGraphRuntime and CodegenUnits are seed-bound: src/ is compiled by the pinned seed against the seed's runtime interface, so they go once a seed carrying with_system_info is pinned (said in rt_core, at both call sites and in CLAUDE.md's D30 paragraph, which now states the rule for src/).
Contributor
Author
|
Seed-driven battery GREEN on b99c8d3 (wall 360 s; gate, uat and battery-checks). |
ehartford
added a commit
that referenced
this pull request
Oct 25, 2026
… stand-ins (sysinfo byte form, CiContracts sort, #2225 trim copy) (#2622) * Pin the joint seed nightly-20261025-local-1-c88f3eeff0bc on the four gating platforms Cut from main c88f3ee on the laptop (darwin), eric-5090 (linux-x86_64), win10 (windows-x86_64, published from the laptop) and tools/docker/linux-aarch64, each to a stage2 == stage3 fixpoint with :release-checks green. The first seeds whose runtime interface has with_system_info() -> SysInfo (#2621) and whose codegen gives a closure internal linkage in its codegen unit (#2618). windows-aarch64 stays on local-3 (D137). * Retire the seed-bound sysinfo byte form: BuildGraphRuntime and CodegenUnits read with_system_info() -> SysInfo The pinned seed now carries the record form (#2621), so the byte-form with_sysinfo(out) in rt_core and the two SysInfo copies in the compiler are deleted; CLAUDE.md D30 paragraph names the stand-in as the pattern a pin stack retires. * CiContracts: the contracts artifact sorts its names with List.sort() The insertion sort stood in while the pinned seed lacked the #2618 fix (a closure symbol external to its codegen unit was stripped at the stage1 link); the 2026-10-25 seed carries it. A name is a str, a value (D111): it is pushed, not cloned. * rt_core: delete the owned str trim copy the STR_TRIM intrinsic once called (#2225) str.trim() has been a std view method since 46876b6 (2026-10-07); no seed since lowers an intrinsic to with_str_trim_ref, and nothing in the tree names it. It was marked to retire at the next seed bump. --------- Co-authored-by: Eric Hartford <[email protected]>
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.
The
src/extern sweep Eric asked for after thewith_sysinfo(&info as *mut u8)question (D30 step 4's follow-up).src/are gone:str_from_byte,i64_to_string(already imported throughrt.rt_core),abort/exit/strerror/strtod(use std.libc.*),rt_read/rt_write/rt_close/rt_seek/rt_getcwd(use rt.platform). Thewl_*/clang_*bridge entries and the toolmains stayextern: they are C symbols of our own bridge objects.exitdeclared as returning left dead code after it; threeunsafeblocks wrapped libc calls that are safe by declaration;strtodwas spelled over*const u8where libc says*const c_char.rt_coredeclaresSysInfoonce andwith_system_info() -> SysInfo;std.sysreads the record. The byte formwith_sysinfo(out)and the record copies inBuildGraphRuntimeandCodegenUnitsare seed-bound (src/is compiled by the pinned seed against the seed's runtime interface) and go at the next seed cut, which is written down at both call sites, inrt_core, and in CLAUDE.md's D30 paragraph, which now states the rule forsrc/.Battery: seed-driven, posted below when green.