verifier: resource limits, CFG, SSA dominance and types (P0-7..P0-10)

- verifier.zig: staged pipeline per spec 07 §8.6, deterministic order
- budget.zig: fixed limits from spec 08 §7 (E5101)
- cfg.zig: terminators, branch arity, switch/enum.switch shape (E5002)
- ssa.zig: Cooper-Harvey-Kennedy dominators, use dominance (E5001)
- types.zig: operand/result types, casts, calls, returns, recursive
  aggregates (E1001, E1002, E1003)
- check.zig runs parse -> verify; seed conformance tests get module
  headers; tests for unimplemented phases report PENDING
This commit is contained in:
dev committed 2026-10-04 12:24:41 +03:00
1 parent ef6a2c5475
commit 50bf990355
14 files changed
+892 -11

No files matched your search

+11 -6
View File
@@ -1,8 +1,10 @@
//! Front door used by the CLI, the conformance runner and (later) `ajid`:
//! parse → verify, collecting diagnostics.
//! parse → verify, collecting diagnostics (spec 07 §8.6).
const std = @import("std");
const air = @import("air.zig");
const diag = @import("diag.zig");
const verifier = @import("verifier.zig");
pub const Status = enum {
/// Module verified; no error diagnostics.
@@ -16,15 +18,18 @@ pub const Status = enum {
pub const Report = struct {
status: Status,
diagnostics: []const diag.Diagnostic,
/// Present when `status == .accepted`.
module: ?air.Module = null,
/// Pipeline stage that is missing when `status == .unimplemented`.
missing_stage: []const u8 = "",
};
/// Checks a text AIR module. All allocations go into `arena`.
pub fn checkAir(arena: std.mem.Allocator, file_name: []const u8, source: []const u8) !Report {
_ = arena;
_ = file_name;
_ = source;
// TODO(phase-0): air.parse → verifier.verify.
return .{ .status = .unimplemented, .diagnostics = &.{}, .missing_stage = "air.parse" };
const parsed = try air.parse.parse(arena, file_name, source);
if (parsed.diagnostics.len != 0) return .{ .status = .rejected, .diagnostics = parsed.diagnostics };
const module = parsed.module.?;
const ds = try verifier.verify(arena, file_name, module);
if (ds.len != 0) return .{ .status = .rejected, .diagnostics = ds };
return .{ .status = .accepted, .diagnostics = &.{}, .module = module };
}