Skip to content

Expand Whale scalar support and remove unused std::libc bindings - #924

Merged
LunaStev merged 3 commits into
wavefnd:masterfrom
LunaStev:feat/whale-scalar-integration
Oct 16, 2026
Merged

LunaStev merged 3 commits into
wavefnd:masterfrom
LunaStev:feat/whale-scalar-integration

Conversation

@LunaStev

@LunaStev LunaStev commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Remove the ten unused std::libc binding modules, their policy exemption, and obsolete documentation. Add a migration note for users of the removed import paths.

  • Update the official Whale master dependency to 9eed1958d37a02000c440a5efcbf87beeb60aa7a, adapt format-5 round trips, and set explicit interpreter resource budgets.

  • Accept canonical scalar aliases and alias chains from Typed HIR. Lower bool &, | and ^ eagerly, preserving source order and once-only evaluation.

  • Execute generated direct integer/void calls, nesting and recursion in bounded oracle tests, including shared fuel, memory, depth, frame and live-value limits.

  • Share the macOS LLVM prerequisite between build/test and packaging; disable automatic Homebrew metadata updates and upgrades of installed requested formulae.

Motivation

Closes #875
Closes #915
Closes #916
Closes #917
Closes #923
Closes #925

Scalar alias declarations previously rejected otherwise supported programs, and bool bitwise operations were incorrectly dispatched as comparisons. The upstream dependency update enables direct-call oracle coverage while keeping unsupported instructions and resource exhaustion distinct from successful execution. The unused C bindings are being removed from std so they can be supplied independently.

The initial CI run passed 34 of 35 jobs. The macOS amd64 package job alone timed out during LLVM provisioning: its unconditional Homebrew update triggered a 29-minute CMake source build. Packaging now uses the same prerequisite as the successful build/test lane and applies Homebrew's documented update and upgrade controls.

Related to #773; full cross-backend and native execution parity remains separate.

Target and compatibility impact

LLVM remains the default, with the existing --whale CLI and Linux amd64/O0 textual-IR scope unchanged. Consume existing HIR types and ordered conversions without changing frontend semantics. Aggregate, pointer and over-128-bit aliases remain unsupported by Whale and produce source diagnostics; failed builds preserve previous output.

Existing std::libc::* imports no longer resolve. Users must use the relevant Wave APIs or provide external C bindings. Existing std/sys providers, generated C I/O, supported LLVM targets, version and release behavior are unchanged. No external binding repository is created here.

Oracle coverage uses the upstream bounded interpreter and reader/verifier. It does not add native Whale execution, floating execution, or an automatic LLVM fallback. Contributor-owned #714 and #909 remain separate.

Validation

Rust 1.89.0, Cargo jobs=2, LLVM 21:

  • 421 unique Rust tests passed across 46 suites, using the workspace run and final focused reruns of the CLI (16) and Whale (26) suites.
  • 54 relevant Python tests and the std policy check passed. The CI follow-up covers macOS amd64/arm64 provisioning, all macOS lanes, installation failure/timeout propagation, wrong LLVM majors and the non-provisioning path. No surviving std::libc imports remain in std Wave sources.
  • Clippy with warnings denied, rustfmt, touched-file function spacing and diff whitespace checks passed.
  • Bool truth tables, eager operand effects and traps, alias equivalence, source locations and output preservation are covered. Calls are tested across every supported integer width, with separate trap, unsupported and resource-limit outcomes.

Commands used:

LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo +1.89 test --locked --offline --workspace --all-targets --jobs 2 --target-dir /tmp/wave-alpha-nine-target
LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo +1.89 test --locked --offline --jobs 2 --test whale_backend -p whale --lib -p wavec --target-dir /tmp/wave-alpha-nine-target
LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo +1.89 test --locked --offline --jobs 2 -p whale --lib --target-dir /tmp/wave-alpha-nine-target
LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo +1.89 clippy --locked --offline --workspace --all-targets --jobs 2 --target-dir /tmp/wave-alpha-nine-target -- -D warnings
python3 -m unittest tools.test_release_gates
python3 -m unittest tools.test_ci tools.test_release_gates tools.test_release_publish
./tools/check_std_policy.sh
cargo +1.89 fmt --all -- --check
git diff --check

The workspace invocation initially stopped on a new test's source-location expectation; another new positive fixture used a frontend-rejected void alias. Both test fixtures were corrected and the final CLI and Whale runs above passed, without changing production code for those corrections. Existing local socket regressions ran with the required permission. Remote platform CI remains to run on this PR.

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/.

Remove the ten unused binding modules and their policy-checker exemption.
Document the removed import paths and external-binding migration while
preserving the existing OS providers and generated C I/O behavior.

Refs: wavefnd#923
Signed-off-by: LunaStev <luna@lunastev.org>
Resolve the official master dependency to 9eed1958 and adapt format-5
round trips and explicit interpreter resource budgets.

Consume canonical scalar aliases from Typed HIR and lower eager bool
bitwise operations with verified select and comparison instructions.
Exercise direct integer/void calls, recursion, evaluation order, traps
and shared execution budgets through the bounded upstream interpreter.

Refs: wavefnd#875
Refs: wavefnd#915
Refs: wavefnd#916
Refs: wavefnd#917
Signed-off-by: LunaStev <luna@lunastev.org>
Use the same LLVM prerequisite as the successful macOS build/test lanes
instead of refreshing Homebrew before packaging. Disable automatic
metadata updates and upgrades of installed requested formulae while
retaining installation, version checks and existing timeout budgets.

Cover both macOS architectures and all shared lanes, failure propagation,
wrong LLVM majors and non-provisioning behavior in tooling regressions.

Refs: wavefnd#925
Signed-off-by: LunaStev <luna@lunastev.org>
@LunaStev
LunaStev merged commit cb55bfa into wavefnd:master Oct 16, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment