Repository navigation
Conversation
ehartford
force-pushed
the
va-list
branch
6 times, most recently
from
September 11, 2026 10:04
cd08b87 to
647e152
Compare
added 5 commits
September 11, 2026 03:13
va_list was modeled as the migration host's shape — a pointer on Darwin. A variadic definition migrated on macOS (zlib's gzprintf, pcre2test's cfprintf) got `var va: *mut i8`, so llvm.va_start wrote into an 8-byte slot; on SysV x86_64 the __va_list_tag is 24 bytes and vsnprintf wants a pointer to it, so the drift harness crashed with a corrupted stack (exit 139, #1103's linux lane). Only variadic definitions that read varargs are affected; calls and externs already work. c_va_list (TypeKind.TY_VA_LIST) is Copy, sized by TypeLayout per target — 8 bytes (pointer) on Darwin/Windows, 24 on SysV x86_64, 32 on AAPCS64 Linux — and lowered to a pointer or a byte buffer in codegen. On Linux a c_va_list parameter uses the share-place ABI (a pointer to the caller's list, C's array decay): Sema.sig_param_is_c_va_list_by_place sets value_ref_abi, the extern prologue declares the param as ptr, and the call site passes the address. Verified from the IR: vsnprintf takes ptr, the call passes the 24-byte alloca's address on linux_x86_64 and the loaded char* by value on darwin. The migrator emits c_va_list for C's va_list: translate_type_recursive (ClangBridge) checks the pre-canonical spelling so a macOS `char *` va_list is caught before it decays, the structural path returns c_va_list, and std.libc's vsnprintf/vfprintf/vprintf take c_va_list. A corpus migrated on one host now runs its variadic definitions on the others. Corpora re-promoted in this batch; docs/with-abi.sha256 re-recorded because TypeLayout.w changed.
…n, zlib half) Re-migrated gzwrite.c with the va_list-aware migrator: __local_va and gzvprintf's __param_va are c_va_list, not *mut i8 — the only delta from the committed file (defs.w's SDK-macro drift discarded, that is #1102). The pcre2 half (pcre2test.w's cfprintf) is blocked on #1102: re-migrating pcre2 now emits the host SDK's macros into defs.w and they collide (shadowing errors), so #1102 must land before pcre2 can be re-promoted. WIP: the branch does not build until pcre2test.w is re-promoted and docs/with-abi.sha256 re-recorded.
LLDB proves declare_extern_fn+372 selected curated memchr signature 244 (2 parameters) for the raw 3-parameter declaration and panicked at parameter 2. Record signatures by declaration node. memchr/memcmp execution, memchr audit:all (11617 facts, zero violations), and both va_list regressions pass.
Run 34426003885 reported the va_list regression without its per-test stderr or any downloadable artifacts. Preserve the same test graph and p7 captures as Windows, plus the runner compiler for debugging.
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.
C va_list now retains its target-specific identity through migration, typedefs, explicit pointers, layout, and call lowering. SysV x86_64 uses the caller's place; other targets preserve value semantics through the shared ABI marshaller. Target-aware auditing checks the caller copy, and raw extern declarations retain their own signature when a curated wrapper takes the public name.
Regression coverage spans all five targets and executes mixed integer/floating-point variadic arguments beyond register capacity. Linux C callbacks and SysV With function-value parameters that lack the shared callable-type descriptor fail explicitly; the remaining foundation work is tracked in #1106.
Based on #1107's native/interpreted action paths, approved SDK expectations, scoped gunzip cleanup, compiler cleanup fixes, independent MIR validator tests, and bounded compiler partitions for small-memory hosts.
Local verification passed: full build, byte-identical fixpoint, full tests (997 behavior files and 16 internals tests; 415 MiB peak test-target RSS), test-green/last-green evidence for f501b64, fresh pinned v0.15.2.0 bootstrap, compiler audit (2,510,543 facts / zero violations), and 15 move / 115 drop cases with zero regressions.
All five native CI platforms passed on f501b64: macOS ARM64, Linux x86_64, Linux ARM64, Windows x86_64, and Windows ARM64. The macOS full battery passed at 415 MiB peak test-target RSS; its internals tests completed in 9.6 seconds.
The seed-compat cache defect found during verification is tracked in #1113; bootstrap evidence comes from a fresh run against the final tree. No seed update or installation.
Fixes #1104.
Fixes #1105.