Commit Graph
3 Commits
Author SHA1 Message Date
dev 591f0aea19 P6A-7 for the freeze: three reference programs in source; source construct coverage
- programs/parallel_map, channel_transfer, tcp_echo_tasks: the Phase 3 exit
  programs in .aji, with AIR equivalence on every schedule seed
- tools/source_coverage.py: every .aji construct (56) has a run/accept test
  and, where it rejects, a reject test; CI step
- gaps filled: wrapping arithmetic run test, break outside a loop (E7006),
  close_receiver without pending (E7004)
- plan: P6A-7 freeze criterion (owner decision); further twins gradually
2026-10-05 18:15:48 +03:00
dev 748eddf4e5 P6A-11, P6A-12: malformed lowering is an internal compiler error; source type-check completeness
P6A-11: when a .aji module passed the frontend but its AIR does not parse
(E0001-E0005) or has invalid SSA/CFG (E5001, E5002), the result is one
E7900 source.internal_compiler_error at the source construct, with the
AIR code in air_code; semantic codes (E0006 included) are unaffected.
Unit test injects the checkpoint's `ret %` defect.

P6A-12: source-decidable type errors are E7005 at the source:
- `as` checks lossless widening with the verifier's own rule (shared
  function), and that both sides are integers
- slice.copy element types; own.free / region.destroy operand types
- element rules of channel.make<T> and mutex.make (no borrow, scope,
  task, shield or guard, at any depth)
Probing every source position found no other E1001/E1002 leak. The old
test encoding the previous rule (verifier_widen, E1002) is replaced by
typecheck/lossy_widen (E7005); 9 typecheck tests. Spec 15 §10 states the
frontend/verifier boundary.
2026-10-05 18:10:53 +03:00
dev ba3e9b3719 Phase 6A: .aji frontend, layer 1 (scalars, expressions, functions, control flow)
src/frontend: lexer, AST, parser for the full 6A grammar (first error
only: one E7001 with span, expected and found), lowering to canonical
text AIR with a line map. Variables become SSA with block parameters
carried across if/while/for/loop joins; short-circuit and/or; checked,
wrapping and cast forms; calls; untyped let literals typed from later
uses, never guessed (E7007). The frontend repairs nothing.

check.checkFile: .aji → frontend → existing AIR parser and verifier;
every diagnostic at its source location, AIR location kept as
air_line/air_col; trap records gain source_location. CLI: check/run on
.aji, aji lower [--annotate].

Runner: .aji tests with the same headers; every accepted module must
lower deterministically, be canonical (lower → parse → print
unchanged) and match <file>.expected if present. Layer-1 tests: 6 run,
6 E7xxx rejects, 2 verifier-caught (E1002, E3101).
2026-10-05 11:23:18 +03:00