Skip to content

Phase 5: prove the backend on real corpus programs #78

Open
2 of 4 issues completed
Open

Description

@biuld

Why this phase

The backend rows (BE-01..BE-28) are the parts of the matrix with no official-suite evidence, because no harness has ever compiled and run a corpus passing file. Phase 1 builds that harness; this phase uses it.

The backend is not the bottleneck in most cases — the frontend is. What the backend needs is proof that a representation decision holds for real programs, not more representations. BE-27 currently has vertical execution tests for the implemented slice and nothing else.

Sub-issues

Tracked as children of this epic. Known gaps at planning time:

  • Backend: Wasmtime execution harness for synthesized WIT ABI fixtures #73 — a Wasmtime harness that executes synthesized WIT aggregate fixtures. All 20 fixtures under crates/psrs-backend/src/mir/indirect_tests/aggregate/ (result, option, variant, nested payloads, flags, non-byte list, list<record>, resource-in-result, large return area, indirect parameter record) currently end at validate_all. Only list<tuple<string,string>> executes, because it is the one shape reachable from source. The blocker is that mir/gc_tests' run_gc is private, pinned to the real WASI command world, and the fixtures import a synthesized wasi:io/streams function with no host implementation; wasm/lower/post_return/tests.rs shows the pattern that works for an import-free fixture world.
  • BE-13..BE-16 — cover the remaining MIR instruction forms and pass the L6/M7 gate with per-operation validation.
  • BE-05..BE-10 — broaden source-path coverage for enum tags, field-bearing ADTs, newtype erasure, parameterized ADTs, records, and arrays past the cases the acceptance records cover.
  • BE-01, BE-02, BE-03 — general control flow beyond enum-tag Switch, remaining partial applications, recursive and mixed-field layouts.

Gate

Every in-scope passing file for an implemented backend feature compiles, validates, and runs with the expected observable result, and the runtime scoreboard reports per-file agreement.

References

  • docs/design/D-04-suite-roadmap.md — M7, BE matrix, CC/MIR crosswalk
  • docs/implementation/backend/ — topic acceptance records
  • crates/psrs-backend/src/mir/gc_tests/mod.rs — the existing execution harness and its limits

Validation

cargo fmt --all --check
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
PSRS_REQUIRE_WASMTIME=1 cargo test --workspace

Activity

  1. biuld commented on Oct 16, 2026

    @biuld
    OwnerAuthor

    The runtime scoreboard now has a full-board number. On 2026-10-17, at 886cd82c and Wasmtime 49.0.3, L6/M7 is 273/413 (was 164/413). All 273 agreeing cases exit 0, and none trap.

    The other 140 are 69 library-foreign link failures, 34 P5 typecheck, 13 P8 closure conversion, 11 P5 kind check, 6 P3, 4 P0, one P7 command-runner mismatch (Sequence.purs), one 10-second timeout (2288.purs), and BigFunction.purs, which the OS kills before a diagnostic. The phase stays open because L6 is not complete.

    Recorded by #145.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions