Repository navigation
Record typed HIR conversions and add checked std operations - #744
Merged
LunaStev merged 6 commits intoSep 25, 2026
Merged
Conversation
Extract declaration lookup, numeric compatibility, diagnostics, and semantic records behind the existing verification facade. Keep mutable validation state and HIR recording with their current owner. Refs wavefnd#720 Signed-off-by: LunaStev <[email protected]>
Keep shared transport records and attribute emission behind the existing facade while preserving all classifier bodies and supported targets. Refs wavefnd#740 Signed-off-by: LunaStev <[email protected]>
Preserve cursor and output state on failure, validate tenth-byte sign extension, and emit minimal i64 encodings. Add exact encoding and failure-state fixtures. Refs wavefnd#718 Signed-off-by: LunaStev <[email protected]>
Check unsigned layout sizes and element-count multiplication before access. Preserve zero-sized no-ops, overlap-safe copy and move behavior, and existing explicit-size APIs. Refs wavefnd#719 Signed-off-by: LunaStev <[email protected]>
Resolve conversion kinds, signedness, computation widths, modes, and spans in the frontend. Verify conversion chains before codegen and share their LLVM lowering between constants and runtime expressions. Preserve projected dereference storage types and reject missing numeric boundary conversions. Add HIR invariant tests and native, wasm32, and AArch64 O0/O2 fixtures for conversions and the checked std additions. Refs wavefnd#721 Signed-off-by: LunaStev <[email protected]>
Record scalar pointer facts and propagate pointee array types into literal elements before conversion planning. Lower addressed arrays from the frontend layout instead of inferring storage from the first LLVM value. Cover the shared test73 assignment regression and mixed-width, floating, nested, grouped, and boolean array literals at O0/O2. Signed-off-by: LunaStev <[email protected]>
Open
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.
Summary
Addressed array literals retain their pointer and element contexts in HIR, so assignment, calls, and nested arrays use the destination storage widths without backend type inference.
Motivation
Numeric lowering previously reconstructed conversion decisions across several LLVM paths. For example,
i32 -> u8 -> i32must retain its intermediate truncation, and integer division must complete before conversion to a floating destination. Frontend-owned facts establish a shared semantic contract for LLVM/Whale coexistence.Signed LEB128 and type-derived memory sizes also remove repeated, error-prone byte encoding and layout calculations from callers.
Closes #718
Closes #719
Closes #720
Closes #721
Closes #740
Target and compatibility impact
Validation
With
LLVM_SYS_211_PREFIX=/usr/lib64/llvm21, after the addressed-array correction:cargo test --workspace --jobs 2— 289 passed, including 99 codegen regressions. The added HIR test reproduced the missing scalar facts before the fix;shared/test73.waveand the new addressed-array fixture pass at O0/O2.python3 tools/run_tests.py --wavec /tmp/wave-pr744-ci/wavec-checkout --target-id linux-amd64 --report-json /tmp/wave-pr744-ci/native.json— 170 cases passed. The HTTP server case (linux/amd64/test5.wave) collided with an existing service on port 8080 and passed separately using a temporary copy with an unused port. The wrapper uses the checkout-built compiler and an aliased copy of repository std.shared/test73.waveandtests/fixtures/addressed_arrays/main.wave— 60 successful object compilations across all 15 CI targets at O0/O2. The new fixture additionally passed 12 executions across AArch64/RISC-V/LoongArch QEMU, wasm32/Node, wasm64/Node, and WASI/Node at O0/O2.cargo clippy --locked --workspace --all-targets --jobs 2 -- -D warnings,cargo fmt --all -- --check, andgit diff --checkpassed.Earlier implementation validation also passed the feature-isolated core64 workspace (275 tests), the Wave corpus (288 files and 26 std examples), and checked std fixtures on amd64, wasm32, and AArch64. Windows/macOS execution remains covered by CI; local checks for those hosts are cross-target compilation and ABI contract tests.
Checklist
Signed-off-byline.std/.