v3: fix self-host OOM and five checker/cgen regressions blocking -building-v - #27973
Conversation
79e0c1c armed qualify_name_cache on the main checker permanently. Under -prealloc, scoped driver stages then grow the cache map inside disposable scope arenas, and freeze_interface_impl_names later reads freed buckets (SIGSEGV in map_get_check). Restore the nil-unless-armed discipline; the parallel cgen forks keep their private armed instances.
d2ecd5e to
3d80692
Compare
|
Rebased on master. Note: the rebase surfaced a separate master regression from 79e0c1c — permanently arming |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d80692d60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if source.value == 'range' { | ||
| // A gated range index yields a slice of the container, not an element. | ||
| if base_type is ArrayFixed { | ||
| return Type(Array{ | ||
| elem_type: base_type.elem_type | ||
| }) | ||
| } | ||
| if base_type is Array || base_type is String { | ||
| return base_type |
There was a problem hiding this comment.
Add regression coverage for gated range slicing
This changes Option/Result payload typing for s[a..n] or { ... }, including distinct string, dynamic-array, and fixed-array paths, but the commit adds no test file. Without a focused regression test, the original element-vs-slice typing failure can recur unnoticed; please add coverage for these gated range cases as required for Option/Result behavior changes.
AGENTS.md reference: AGENTS.md:L657-L659
Useful? React with 👍 / 👎.
`./v3 -nocache -building-v -o v4 -no-memory-limit v3.v` was OOM-killed by macOS right after the parse phase (the process allocated at ~20 GB/s in the parallel checker until jetsam sent SIGKILL — `-no-memory-limit` only disables the internal watchdog, not the OS kill). Fixing the OOM then exposed five more self-host blockers. With this PR the full bootstrap chain is green again: v1 → v3(prod) → v4 → v5, ~1.8 s total, ~740 MB steady footprint.
Memory explosion (checker)
Checker fixes
Transform fixes
Cgen fixes (-building-v)
Each fix was reduced to a minimal repro first (match-tuple exit branches, guard destructuring, slice-or, `.str` infix, `import v.token` under `-building-v`), and all repros compile and run correctly after the fix.