Skip to content

Stabilize compiler inputs, target ABIs, and freestanding runtimes - #798

Merged
LunaStev merged 2 commits into
wavefnd:masterfrom
LunaStev:fix/release-architecture-stabilization
Sep 26, 2026
Merged

LunaStev merged 2 commits into
wavefnd:masterfrom
LunaStev:fix/release-architecture-stabilization

Conversation

@LunaStev

@LunaStev LunaStev commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Fix the selected compiler, standard-library, target ABI, and release-publication defects:

  • Reject output paths that alias command-line or imported inputs before writing artifacts; keep identity pass-through emits safe.
  • Add --std-root PATH with explicit precedence and no installed fallback. Validate the root once when preparing the compilation environment, then pass the resolved root to imports. Use the checkout std in corpus validation without changing HOME.
  • Diagnose global constant dependency cycles in the frontend, including imported declarations, while preserving acyclic forward references.
  • Correct RISC-V aggregate eligibility and GP/FP register accounting for lp64/lp64f/lp64d, including integer-convention fallback and indirect aggregate transport.
  • Preserve 16-byte alignment when passing small AArch64 aggregates through C ABI boundaries.
  • Supply demand-driven, private wasm64 helpers for 128-bit division, remainder, multiplication, variable shifts, and integer/float conversions, without libc or an external runtime SDK.
  • Disable implicit LoongArch LSX when D is disabled and reject explicitly incompatible SIMD feature combinations.
  • Preserve WASI errno values, recognize interruption by target, and retry sleep against a fixed monotonic deadline. Populate remaining time for interrupted raw WASI nanosleep calls and submit relative poll timeouts for real Node WASI compatibility.
  • Recheck canonical master immediately before release creation; abort on drift, malformed responses, or API failure.

Motivation

These defects can destroy compiler inputs, defer frontend errors to code generation, corrupt C interoperability, leave compiler-generated WebAssembly arithmetic imports unresolved, retry permanent WASI errors, or publish an outdated release revision.

Closes #745
Closes #767
Closes #751
Closes #776
Closes #777
Closes #778
Closes #792
Closes #754
Closes #706

Target and compatibility impact

--std-root is invocation-local; omitting it retains the installed-root default. An invalid explicit root is an error even when no std imports are present. CLI help and diagnostics describe the behavior.

Native C ABI changes affect RISC-V64 and AArch64. LoongArch feature resolution now matches the emitted floating-point instruction set. wasm64 arithmetic support is compiler-owned and separate from application host imports. WASI interruption uses its native errno namespace, and sleep retries consume only the remaining duration.

macOS and Windows native execution was not available locally. AArch64 Linux/Darwin/Windows objects were generated and their aggregate transport compared with Clang. Existing contributor-owned Windows and case-selection work is outside this change.

Validation

Local LLVM prefix: /usr/lib64/llvm21; Cargo commands used --locked --jobs 2.

  • cargo test --workspace: 300 tests passed with a fresh temporary directory and socket access for networking tests.
  • WAVE_RUN_WASM_RUNTIME_TESTS=1 WAVE_RUN_RISCV64_INTEROP_TESTS=1 WAVE_RUN_AARCH64_INTEROP_TESTS=1 cargo test --test release_stabilization: 10 tests passed, including 56 Clang/QEMU aggregate cases across AArch64 and RISC-V lp64/lp64f/lp64d at O0/O2.
  • WebAssembly-only feature build: cargo test --no-default-features --features llvm-target-wasm --test release_stabilization webassembly_ with WAVE_RUN_WASM_RUNTIME_TESTS=1. O0/O2 execution covered arithmetic boundaries, rounding, private helper reuse, interrupt sequences, partial I/O, permanent errors, and sleep deadlines.
  • Real Node WASI sleep runs at O0/O2 with a 10-second child-process timeout; the regression times out with the previous absolute subscription and passes with relative waits. The WASI example also passed O0/O2 execution and wavec run using the checkout std.
  • Existing GCC/QEMU RISC-V and AArch64 C ABI tests passed, including all three RISC-V ABI modes.
  • python3 tools/check_wave_corpus.py --wavec target/release/wavec --run-std-examples: 289 corpus sources and all 26 std examples passed. Execution used socket access for the networking examples.
  • Release-publication tests execute the workflow script with a mock gh, covering matching master, drift, empty/malformed responses, and API failure without publishing anything.
  • Warning-free RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps and cargo build --release passed.
  • Python bytecode compilation and the required tooling suites passed: 56 tests run, 55 passed, 1 existing platform skip.
  • cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --all --check, git diff --check, and standard-library policy checks passed.

Checklist

  • Commits include a DCO Signed-off-by line.
  • Tests cover new behavior or the PR explains why no test is needed.
  • User-facing changes include documentation or diagnostics updates.
  • The change preserves the license boundary between the compiler and std/.

Protect compiler inputs, resolve an explicit std root once, and reject
constant dependency cycles during semantic validation.

Correct RISC-V and AArch64 aggregate C ABI transport, align LoongArch
features with emitted instructions, and provide private wasm64 arithmetic
helpers. Preserve WASI errors and retry sleep against a monotonic deadline.

Recheck canonical master immediately before publishing a release and add
focused regression coverage to the existing target CI jobs.

Refs: wavefnd#745, wavefnd#767, wavefnd#751, wavefnd#776, wavefnd#777, wavefnd#778, wavefnd#792, wavefnd#754, wavefnd#706
Signed-off-by: LunaStev <[email protected]>
@LunaStev
LunaStev merged commit d1036a0 into wavefnd:master Sep 26, 2026
25 checks passed
@LunaStev LunaStev mentioned this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment