Skip to content

Move IR, assemblers and bytecode to Wave under Meson - #398

Merged
LunaStev merged 8 commits into
wavefnd:masterfrom
LunaStev:feat/wave-meson-modules
Oct 31, 2026
Merged

LunaStev merged 8 commits into
wavefnd:masterfrom
LunaStev:feat/wave-meson-modules

Conversation

@LunaStev

@LunaStev LunaStev commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

This PR delivers the eight ordered batches of #335 in exactly eight DCO-signed commits.

  1. Explicit source/module boundaries and selected-product dependency checks. Closes Enforce source module boundaries and explicit ISA product selection #339.
  2. Meson product/host selection, pinned Wave bootstrap, offline builds and artifact guards. Closes Introduce Meson as the top-level Whale build test and install entry point #344, closes Unify Wave kernel builds behind a pinned compiler and provenance lock #345, closes Track Wave and Cargo source dependencies correctly in Meson builds #346, closes Separate build host and generated-code targets in Meson module configuration #347.
  3. Wave IR construction, text formats, layout, verification and AST/HIR lowering. Closes Implement the typed IR model and transactional builder in Wave #348, closes Parse and print versioned Whale IR in Wave with bounded streaming #349, closes Implement target layout and structural SSA verification in Wave #350, closes Implement checked frontend AST lowering in Wave and preserve the public interchange #351, closes Add a minimal typed frontend adapter for Wave scalar functions #149.
  4. Wave numeric/constants/tracked-memory semantics, interpreter and transactional passes/folding. Closes Implement fixed-width integer casts comparisons and constant evaluation in Wave #352, closes Implement deterministic f16 f32 and f64 semantics and conversions in Wave #353, closes Implement tracked memory call frames and runtime values in Wave #354, closes Run verified transactional IR passes and effect analyses in Wave #355, closes Fold scalar integer constants without changing trap semantics #118.
  5. Shared Wave assembler utilities and AMD64 parsing, relaxation and integer/SSE encoding. Closes Implement shared Wave assembler utilities and neutral assembly output #356, closes Port the supported AMD64 assembler parser and encoder to Wave #357.
  6. Role-separated AArch64, RV64I and LoongArch64 Wave assemblers and per-ISA asmobj relocation handling. Closes Port the existing AArch64 assembler subset to role-separated Wave modules #358, closes Port the existing RV64I assembler subset to role-separated Wave modules #359, closes Port the existing LoongArch64 assembler subset to role-separated Wave modules #360, closes Separate per-architecture object and relocation translation in asmobj #361.
  7. Versioned Wave bytecode admission/compiler/VM and explicit CLI composition, including products without assemblers or native linking. Closes Specify and verify versioned Whale bytecode in Wave #362, closes Compile verified IR to Whale bytecode in Wave #363, closes Execute Whale bytecode with a Wave interpreter and runtime adapters #364, closes Compose selected assemblers, bytecode backend and execution paths in the CLI #365.
  8. Default Wave products, explicit Rust references, retained/transient workspace accounting, replayable conformance, portable provenance, standalone packaging and real CLI benchmarks. Closes Make migrated Wave modules the default product path and isolate Rust reference implementations #368, closes Gate Wave source modules with conformance, bounded fuzzing and host-aware CI #369, closes Package reproducible standalone Wave-backed Whale binaries #370, closes Document and benchmark the Wave source-module contribution workflow #371.

Wave owns core algorithms in role-specific source files. Rust retains typed data/allocation, file/OS/CLI/FFI and object/linker infrastructure. Architecture contributions edit explicit source, dispatch and build lists. Default Meson products require the selected Wave modules; reference algorithms require explicit rust-reference. build-info --json reports actual linked module stamps and portable compiler/source/archive provenance.

Local validation of the eight-batch implementation:

  • Actual Wave workspace: 737 all-feature tests, 607 default tests; explicit reference workspace: 649 tests, with four intentional ignores in each. Native Clippy, warning-free rustdoc, Rust 1.86 and 122 Python tests pass.
  • Official IR O0/O2: 100,051 admission checks each, including 100,000 mutations, 40 independent binary fixtures, exact work/workspace boundaries and large UTF-8/type/instruction inputs. Writer: 11 exact byte goldens and 10,000 mutations per optimization. Saved originals replay without replacement.
  • Actual Wave IR/AST/bytecode campaigns: 5,000 cases each with resource caps and saved replay records. Allocation probes verify the 8 MiB workspace ceiling and full reclamation of temporary argument buffers. Public bytecode/policy tests: 13 per optimization; real archive/selection checks: 12; production module stamps: seven.
  • Meson release/source-IR build, warm build, install, all-ISA and no-ISA/no-linker smoke pass. Package extraction runs selected assembler and bytecode operations with empty PATH and no Wave/LLVM environment.
  • Separate source and build directories produce identical executable bytes and identical deterministic packages. Binary SHA256: 77f36ad8e70668f8aef5f286ae415770b1d2853ad7ebc51cbdb0a9f88c290abe.
  • Benchmark baseline at clean commit f1f2ec3: real CLI benchmarks cover 64/32,768 workloads, 20 phases, 60 measurements and 20 warmups, with independent output checks, full hashes, elapsed time, RSS and embedded module provenance.

Native Wave execution evidence is Linux x86_64 GNU. Other host builds explicitly use reference paths; cross-produced objects do not establish native execution support. The Wave compiler pin is e0952ed65d07e14c6ed0aa64f3c9a5532dd7533b (bootstrap Rust 1.89.0/LLVM 21). Bytecode v1 supports the documented executable subset and rejects external runtime imports. Broader targets and native IR generation remain in their existing roadmaps; #232 remains open.

CI portability fixes keep the Rust 1.86-compatible atomic API, isolate assembler guard fixtures from all ambient module paths, normalize worktree paths, and mock the Linux benchmark timer for portable publication tests. Reduced-product tests check both enabled and disabled native-linker behavior. Local revalidation passes Rust 1.99.1 Clippy (default/all), all eight CLI product configurations, seven dependency graphs, 123 Python tests with native module environment variables, and Rust 1.86 bytecode execution.

GitHub CI on 9a36ce5 is all green: Rust (17 jobs), Quality, Coverage, and Bounded fuzz campaigns. Linux, Windows and macOS native-host test jobs pass; Wave execution support remains limited to the validated Linux x86_64 GNU host described above. No merge or release publication was performed.

Signed-off-by: LunaStev <luna@lunastev.org>
Signed-off-by: LunaStev <luna@lunastev.org>
Implement the complete typed body/global builder model, versioned parser,
bounded canonical printer, layout and SSA verifier in role-separated Wave
sources. Lower the supported AST and pinned Wave typed-HIR boundary through
Wave, preserving evaluation order, source identities and transactional errors.

Keep Rust allocation/typed transport and explicit conformance references.
Numeric evaluation and runtime migration remain the following ordered batches.

Validate actual Wave O0/O2 against independent bounded native vectors, all
workspace features, CLI publication, Meson install and Rust 1.86 checks.

Signed-off-by: LunaStev <luna@lunastev.org>
Implement fixed-width and exact IEEE arithmetic, lazy constant evaluation,
indexed dependencies, tracked memory and call frames in role-specific Wave
sources. Route the interpreter and transactional pass runner through typed
buffer transports; preserve Rust reference algorithms for migration checks.
Add a bounded sparse integer constant folder without changing O0 defaults.

Verify final native O0/O2 archives against independent numeric, memory,
call and folding models; exercise complete workspace, resource, rollback,
CLI and compatibility tests. Keep native host claims limited to Linux AMD64.

Refs wavefnd#352, wavefnd#353, wavefnd#354, wavefnd#355, wavefnd#118.

Signed-off-by: LunaStev <luna@lunastev.org>
@LunaStev
LunaStev force-pushed the feat/wave-meson-modules branch from c5669b3 to cfe74b2 Compare October 31, 2026 04:02
Implement a bounded UTF-8 lexer, checked two-word expressions and neutral
output accounting in shared Wave sources. Move the supported AMD64 grammar,
namespace, relaxation, integer/SSE encoding and public encoding helpers into
role-specific Wave files. Rust retains typed allocation/data bridges and
explicit independent migration references.

Link shared and ISA archives separately through explicit Meson options and
validate pinned source/ABI/provenance before Cargo links either module. Bound
materialized output, sparse storage, work, workspace and copied symbol names.

Verify native O0/O2, exact parser diagnostics, mathematical layouts, NASM
vectors, static Linux executions, workspace tests, Clippy and MSRV 1.86.

Refs wavefnd#356, wavefnd#357.

Signed-off-by: LunaStev <luna@lunastev.org>
@LunaStev
LunaStev force-pushed the feat/wave-meson-modules branch from fe80ea0 to 62f7eb1 Compare October 31, 2026 04:47
Implement the supported AArch64, RV64I and LoongArch64 assemblers in
role-specific Wave sources with a shared bounded source/section/symbol
driver. Keep instruction selection in each ISA, including direct helper
compatibility, and retain independent Rust migration references.

Split asmobj ELF/COFF/Mach-O relocation policy into explicitly dispatched
architecture files. Add selected archive provenance guards and Meson paths.
Preserve sparse BSS, target profiles, exact diagnostics and failure order.

Verify official native O0/O2 archives, independent LLVM/math/source vectors,
whole workspace default/all-feature tests, Clippy, Rust 1.86 and Meson source
products. Foreign instruction words and objects are not native host claims.

Refs wavefnd#358, wavefnd#359, wavefnd#360, wavefnd#361.

Signed-off-by: LunaStev <luna@lunastev.org>
Define canonical bounded little-endian bytecode and admit complete images in
Wave, deriving type, CFG, SSA, call and source facts before execution. Compile
verified IR through the Wave writer and use the resumable Wave runtime with
typed allocation and memory transport.

Compose the explicit bytecode target and bounded atomic CLI commands. Allow
products without an assembler or native linker. Check independent binary
fixtures, exact writer goldens, O0/O2 mutations and Rust reference execution.

References wavefnd#362, wavefnd#363, wavefnd#364, wavefnd#365.

Signed-off-by: LunaStev <luna@lunastev.org>
@LunaStev LunaStev changed the title Build Whale with Meson and move core IR into Wave Move IR, assemblers and bytecode to Wave under Meson Oct 31, 2026
…ecked

Require selected Wave source modules by default, isolate explicit Rust
references, and check the identities of linked modules. Bound retained and
temporary bytecode metadata before allocation and reclaim rejected argument
transport completely.

Embed portable source/compiler/module provenance, validate standalone packages,
and remap build paths. Cover native modules with bounded replayable local
conformance and provide real CLI benchmarks and concise contribution guidance.
Update workflow definitions for native and explicitly labelled reference paths.

References wavefnd#368, wavefnd#369, wavefnd#370, wavefnd#371.

Signed-off-by: LunaStev <luna@lunastev.org>
@LunaStev
LunaStev force-pushed the feat/wave-meson-modules branch from f1f2ec3 to 9a36ce5 Compare October 31, 2026 09:46
@LunaStev
LunaStev merged commit ead740a into wavefnd:master Oct 31, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment