wavefnd / wavefnd/Wave

Verify MSVC stack probing and Windows unwind metadata for generated Wave functions

Open
#618 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted needs testing
Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 22m
Merged PRs (30d)
46

Description

Part of #611. Difficulty: **very high**. Audit baseline: master `3950416e` (2026-09-12).

## Current evidence

The MSVC target foundation in [tests/codegen_regressions.rs](https://github.com/wavefnd/Wave/blob/3950416efc55cbc5ae7d54535e5a4e8699394ff0/tests/codegen_regressions.rs#L6284) checks a tiny entry function. [llvm/src/codegen/ir.rs](https://github.com/wavefnd/Wave/blob/3950416efc55cbc5ae7d54535e5a4e8699394ff0/llvm/src/codegen/ir.rs) builds function IR and relies on LLVM target lowering; there is no dedicated native MSVC large-frame/unwind regression in the audited suite. This is a validation gap, not proof that LLVM emits incorrect metadata.

## Scope

Exercise large live local frames crossing several guard pages, nested non-leaf calls, register spills and supported alignment requirements on x64 and ARM64. Inspect the resulting stack-probe helper resolution and applicable .pdata/.xdata records, then validate stack walking with a native Windows harness. Diagnose and fix any missing codegen attributes or runtime inputs demonstrated by those tests.

## Completion criteria

Tests keep frame contents live and check them after nested calls at multiple optimization levels. Link without MinGW helper libraries and run natively with bounded timeouts. A native stack walk or virtual-unwind probe can traverse generated non-leaf frames and recover expected callers. Do not increase stack reserve merely to hide missing probes. This does not add Wave exceptions or permit foreign exceptions to cross Wave frames. Compiler-process overflow #609 remains a separate bug.

## Dependencies and boundaries

#498; #617, #613; separate from argument/return ABI tasks #615 and #616.

References: [Windows x64 unwindability](https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention#unwindability); [Windows ARM64 ABI](https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions)

Contributor guide

Open the contributing guide

Research direction

Start with the MSVC target coverage in tests/codegen_regressions.rs and the function-IR path in llvm/src/codegen/ir.rs, then read the linked Windows x64 and ARM64 ABI guidance. Run the existing MSVC entry-function regression before investigating large frames, nested calls, probes, and unwind records. Done means native x64 and ARM64 validation passes with bounded timeouts and stack walking recovers expected callers without MinGW helpers.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, operating-systems, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.