0xMiden / 0xMiden/compiler

Check each MASM procedure before writing its HIR body

Offen
#1,304 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @huitseeker Auf GitHub ansehen
design frontend
Vorherrschende Sprache
Rust
Sterne
115
Forks
84
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
15

Beschreibung

## Parent

[0xMiden/compiler#1209](https://github.com/0xMiden/compiler/issues/1209)

## What to build

Lint mode checks known limits before it lifts a procedure. These checks do not cover every rule in `ProcedureLifter`. For example, an invalid local index can pass the checks and fail later in `ModuleRegistry::lift_bodies`. That error stops the whole lint run.

Split lifting into two steps. First, prepare a procedure without changing HIR. This step checks every rule used by the lifter and returns a checked procedure or an error. Then emit HIR from the checked procedure.

In lint mode, prepare all procedures first. Record each failure, skip callers that depend on a failed procedure, then declare and emit only the remaining procedures. Strict mode still returns the first error. The emit step must use the checked form. It must not repeat a separate set of checks.

This gap was found in [compiler PR #1263](https://github.com/0xMiden/compiler/pull/1263#discussion_r3694252804).

## Acceptance criteria

- [ ] An invalid local index becomes a skipped procedure in lint mode.
- [ ] A procedure with valid instructions before an invalid instruction is skipped without leaving HIR behind.
- [ ] Callers of either failed procedure are skipped with the failed callee in the reason.
- [ ] Unrelated procedures still appear in the returned HIR world.
- [ ] No HIR from a failed procedure remains in the world.
- [ ] Strict disassembly still returns an error for the same input.

## Blocked by

None. This can start now.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Look at the ProcedureLifter and ModuleRegistry::lift_bodies in the codebase. The work involves splitting the lifting process into a preparation step that validates all rules, and an emission step. Start by understanding the current error flow from PR #1263. The acceptance criteria list specific failure modes to test; ensure lint mode collects errors without stopping and strict mode fails fast.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
compilers
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.