Skip to content

Fix compiler value and artifact handling, std boundaries, and Whale lowering - #958

Merged
LunaStev merged 9 commits into
wavefnd:masterfrom
LunaStev:fix/nine-correctness-whale
Oct 19, 2026
Merged

LunaStev merged 9 commits into
wavefnd:masterfrom
LunaStev:fix/nine-correctness-whale

Conversation

@LunaStev

@LunaStev LunaStev commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Wave can reuse incompatible generic specializations, overwrite requested LLVM artifacts, and reject valid fixed-array values or computed index bases. The std providers also expose incorrect optimized Darwin syscall state and mixed WASI error numbers. This batch fixes those failures and extends the existing Whale scalar/control-flow subset using verified Typed HIR.

Issue Result
#952 Exact named-type identities remain distinct from structural types, Unicode names and nested generic applications.
#948 Conflicting artifact destinations fail before writes; valid combined emits, identity passthrough and safe atomic replacements remain covered.
#933 Darwin arm64 syscall0–syscall6 declare both x0 and x1 outputs, with optimized allocation regressions.
#945 Synthesized WASI invalid, overflow and unavailable errors use the WASI errno domain while genuine host errors and bare wasm conventions are preserved.
#953 Address-backed fixed arrays materialize at implicit value boundaries and retain independent copy semantics.
#954 Returned arrays and computed pointer/aggregate index bases evaluate once in source order, preserving storage layout and pointer-to-array behavior.
#872 Whale lowers local scalar +=, -= and *= with HIR conversions and wrapping integer arithmetic.
#873 Whale for loops retain initializer scope and route continue through the increment.
#874 Whale consumes verified scalar constant values and preserves dependent casts and local shadowing.

LLVM remains the default. Whale keeps the official Git dependency locked at 9eed1958 and its Linux amd64/O0 verified textual-IR contract. Integer/control-flow tests execute with the bounded interpreter; floating cases verify IR and storage bits. This PR adds no native Whale execution.

Validation (Rust 1.89, Cargo jobs=2, LLVM 21):

  • Exact committed-tree workspace/all-target regression result: 475 tests pass across 56 suites.
  • Default workspace/all-target and AArch64-only Clippy pass with warnings denied; rustfmt, function spacing, std policy and whitespace checks pass.
  • Python tooling: 61 tests pass. Controlled WASI hosts and allocator regressions execute at O0/O2; existing real WASI retry tests pass.
  • Generic/array/index fixtures emit IR and objects for all ten baseline target combinations at O0/O2 (60 builds), and execute on wasm32, WASI and wasm64 at O0/O2 (18 runs). Native Linux amd64 O0/O2 cases pass.
  • Darwin syscall fixtures emit IR/objects for both architectures at O0/O1/O2/O3. Native Darwin allocation runs and Windows-only destination tests are included for CI; they were not executed on the local Linux host.

Closes #952.
Closes #948.
Closes #933.
Closes #945.
Closes #953.
Closes #954.
Closes #872.
Closes #873.
Closes #874.

CI follow-up: run 39130673872 passed 34/35 jobs, including Darwin and Windows build/test lanes. The sole failure was shared/test127.wave in the WASI runtime suite: its unavailable-randomness expectation still used -38 after the provider adopted WASI NOSYS (-52). The shared case now selects the correct target value; random_fill's existing argument-validation results remain unchanged. The controlled-host regression also checks that a nonempty random_fill propagates -52 without modifying its buffer or calling the host.

The original exit-2 failure was reproduced before the fix. Afterward the exact CI-selected WASI runtime list passed 149/149 cases, both focused provider tests passed at O0/O2, and shared/test127 passed 26 cross-target IR/object builds plus eight native/WebAssembly executions at O0/O2. Std policy and whitespace checks pass. The correction is folded into the #945 commit, preserving nine issue-specific commits.

Preserve Typed HIR conversions, wrapping and source-ordered single evaluation for +=, -= and *=. Keep division and remainder explicit unsupported operations.

Closes wavefnd#872

Signed-off-by: LunaStev <[email protected]>
Expose x1 as an output in all BSD syscall wrappers and regress optimized runtime allocation sizes and emitted register constraints.

Closes wavefnd#933

Signed-off-by: LunaStev <[email protected]>
Load address-backed fixed arrays when initialization, nested aggregates or method arguments require independent values. Preserve ordinary lvalue storage behavior.

Closes wavefnd#953

Signed-off-by: LunaStev <[email protected]>
Intern exact named types with disjoint semantic-kind tags so structural names, Unicode and nested applications cannot alias specialization caches. Preserve recursion limits and deterministic reuse.

Closes wavefnd#952

Signed-off-by: LunaStev <[email protected]>
Route continue through the increment and break directly to the exit, preserving initializer scope and source-ordered conditions and effects.

Closes wavefnd#873

Signed-off-by: LunaStev <[email protected]>
Materialize Typed HIR constant values without runtime initializer evaluation. Preserve dependency casts, scalar storage bits, local shadowing and frontend diagnostics.

Closes wavefnd#874

Signed-off-by: LunaStev <[email protected]>
Consume pointer values before index effects and materialize computed aggregate bases once in entry storage. Preserve lvalue writes and pointer-to-array projection and stride.

Closes wavefnd#954

Signed-off-by: LunaStev <[email protected]>
Use target-selected invalid and overflow errors and WASI NOSYS across providers and allocator validation. Preserve genuine host errors, interruption retries and bare WebAssembly conventions.

Closes wavefnd#945

Signed-off-by: LunaStev <[email protected]>
Compare logical and effective destinations before emission, respecting direct writes, atomic replacement, MSVC staging and identity passthrough. Cover normalized, symlink, inode and Windows case aliases without truncating sentinels.

Closes wavefnd#948

Signed-off-by: LunaStev <[email protected]>
@LunaStev
LunaStev force-pushed the fix/nine-correctness-whale branch from 70e4cae to 2d38947 Compare October 18, 2026 13:43
@LunaStev
LunaStev merged commit be6a7a8 into wavefnd:master Oct 19, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment