fix: ReleaseFast crash — avoid LLVM codegen bugs with large tagged unions#99
Merged
loyalpartner merged 1 commit intomainfrom Apr 2, 2026
Merged
fix: ReleaseFast crash — avoid LLVM codegen bugs with large tagged unions#99loyalpartner merged 1 commit intomainfrom
loyalpartner merged 1 commit intomainfrom
Conversation
…ions LLVM in ReleaseFast miscompiles functions containing C FFI calls when large tagged unions (?std.json.Value) are copied by value through ArrayList/Queue, or when such functions are inlined into 8000+ byte mega-functions. Notification pipeline: - OwnedNotification stores params_json: ?[]const u8 instead of ?std.json.Value — serialized in dispatchLoop, re-parsed by consumers - consumeLoop pre-encodes params before group.concurrent capture - OnNotification callback signature changed to pass []const u8 Tree-sitter handler: - getHighlights, extractHighlights, openBufferSafe marked noinline - @Errorname(err) replaced with safeErrorName (noinline + bounds check) - Added Io.Mutex for concurrent onOpen/onEdit/onViewport/onClose VimChannel UAF: - serveStdio/serveTcpOnce heap-allocate ch instead of stack-local Copilot opt-out: - --no-copilot CLI flag, g:yac_copilot_enabled Vim option - Daemon tests pass --no-copilot to skip copilot-language-server Test infra: - Parallel test maxprocesses reduced from 38 to 12 - Makefile release target switched to ReleaseFast
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.
Summary
?std.json.Value) value copies through ArrayList/Queue, and error union returns from functions with C FFI callsserveStdio/serveTcpOnce--no-copilotCLI flag andg:yac_copilot_enabledVim optionChanges
Notification pipeline —
OwnedNotificationstoresparams_json: ?[]const u8(pre-serialized) instead of?std.json.Valueto avoid LLVM codegen bugs with large tagged union value copiesconsumeLoop — Pre-encode params before
group.concurrentcapture; handlers decode from[]const u8Tree-sitter handler —
getHighlights,extractHighlights,openBufferSafemarkednoinline;openBufferSafeuses version comparison instead of error union return;@errorNamereplaced withsafeErrorName(noinline + bounds check); addedIo.Mutexfor concurrent access;onEditskips highlight push when content unchangedVimChannel — Heap-allocated in
serveStdio/serveTcpOnceto fix stack UAFOutbound write — Index-based iteration instead of value copy to fix LLVM slice
.lencorruptionCopilot —
--no-copilotflag,g:yac_copilot_enabledoption, daemon tests skip copilotTest infra —
maxprocesses=12,test_md_inlineskipped (pre-existing timing issue)Test plan
zig build test— 106 unit tests passmake test-parallel— 76 pass, 0 fail, 6 skipped:YacRestartpreserves functionality🤖 Generated with Claude Code