Stabilize frontend semantics and std boundaries - #802
Merged
LunaStev merged 3 commits intoSep 27, 2026
Merged
Conversation
Fix 17 frontend, numeric, CLI, and standard-library issues. Extract typed HIR and async lowering into front/hir and keep exact constant arithmetic in dependency-free utils. Signed-off-by: LunaStev <luna@lunastev.org>
Declare the Darwin secondary return register so optimized syscall wrappers do not reuse clobbered third arguments. Normalize provider fixture line endings, wait for UDP readiness before zero-capacity receive assertions, and add regression coverage and failure diagnostics. Signed-off-by: LunaStev <luna@lunastev.org>
Signed-off-by: LunaStev <luna@lunastev.org>
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
Fix frontend diagnostics, checked numeric operations, and std/CLI boundary cases across 17 issues. Extract typed HIR, conversions, and async lowering into
front/hir; keep exact constant arithmetic in dependency-freeutils::const_int.ByteReaderreads, and exact ULEB128/SLEB128 encoded-length helpers.Motivation
Previously, invalid numeric operations could be silently narrowed or reach LLVM with undefined results, malformed declarations could lose the offending location, and several std/CLI boundaries accepted invalid input or reported misleading results. HIR is now a separate consumer of parser semantic facts, without a reverse parser dependency or external numeric libraries.
Closes #739
Closes #730
Closes #731
Closes #732
Closes #423
Closes #424
Closes #509
Closes #513
Closes #648
Closes #649
Closes #746
Closes #747
Closes #748
Closes #749
Closes #759
Closes #761
Closes #762
Target and compatibility impact
0..LHS bit width, checked before narrowing.hir::TypedProgramandhir::async_lower. Compiler/std compatibility revision remains 4. The frontend dependency graph contains only local crates; no libc FFI or numeric crate dependency is added.Validation
Validation at
7a817450, after HIR extraction and replacement of the numeric dependencies:LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 WAVE_RUN_WASM_RUNTIME_TESTS=1 cargo test --locked --workspace --jobs 2: 317 tests passed, including native O0/O2 regressions and wasm32/wasm64 execution and traps. Local socket/PTY tests ran outside the network sandbox.LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo clippy --locked --offline --workspace --all-targets --jobs 2 -- -D warningspassed.LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 RUSTDOCFLAGS='-D warnings' cargo doc --locked --offline --workspace --no-deps --jobs 2passed.cargo fmt --all -- --check,bash tools/check_std_policy.sh, andgit diff --checkpassed.Earlier validation before the extraction and numeric utility replacement also passed 291 corpus files, 26 std examples, 60 O0/O2 object builds across the ten selected OS/architecture targets, and feature-isolated WASM execution. Actual non-Linux OS execution remains CI validation.
Validation of the CI fixes in
75f8be1d:rdxsecondary return reproduced the optimized failure before the fix and passed afterward at O0/O2. XNU's syscall return implementation writes that register; the optimized output now reloads it before repeated calls.cargo test --locked --test stabilization_17 --jobs 2: 9 tests passed (the opt-in WASM test was not enabled for this focused rerun).cargo test --locked --test std_io_regressions --jobs 2andcargo test --locked --test codegen_regressions darwin_ --jobs 2passed withLLVM_SYS_211_PREFIX=/usr/lib64/llvm21.-D warnings, fmt, Python compilation, std policy, and whitespace checks passed.Checklist
Signed-off-byline.std/.