merge: architecture into loops/haskell — Phases 7-16 complete + Phases 17-19 planned
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 53s

Brings the architecture branch (559 commits ahead — R7RS step 4-6, JIT
expansion, host_error wrapping, bytecode compiler, etc.) into the
loops/haskell line of work. Conflict in lib/haskell/conformance.sh:
architecture replaced the inline driver with a thin wrapper delegating
to lib/guest/conformance.sh + a config file. Resolved by taking the
wrapper and extending lib/haskell/conformance.conf with all programs
added under loops/haskell (caesar, runlength-str, showadt, showio,
partial, statistics, newton, wordfreq, mapgraph, uniquewords, setops,
shapes, person, config, counter, accumulate, safediv, trycatch) plus
adding map.sx and set.sx to PRELOADS.

plans/haskell-completeness.md gains three new follow-up phases:
- Phase 17 — parser polish (`(x :: Int)` annotations, mid-file imports)
- Phase 18 — one ambitious conformance program (lambda-calc / Dijkstra /
  JSON parser candidate list)
- Phase 19 — conformance speed (batch all suites in one sx_server
  process to compress the 25-min run to single-digit minutes)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-08 07:06:28 +00:00
348 changed files with 95235 additions and 13619 deletions

View File

@@ -311,6 +311,54 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
handler returns 0.
- `trycatch.hs` — `try` pattern: run an action, branch on Left/Right.
### Phase 17 — Parser polish
Real Haskell programs use these on every page; closing the gaps unblocks
larger conformance programs and removes one-line workarounds in test sources.
- [ ] Type annotations in expressions: `(x :: Int)`, `f (1 :: Int)`,
`return (42 :: Int)`. Parser currently rejects `::` in `aexp` position;
desugar should drop the annotation (we have no inference at this layer
yet, so it's a parse-only pass-through).
- [ ] `import` declarations anywhere at the start of a module — currently
only the very-top-of-file form is recognised. Real test programs that
mix prelude code with `import qualified Data.IORef` need this.
- [ ] Multi-line top-level `where` blocks (`where { ... }` with explicit
braces and semicolons, in addition to the layout-driven form).
- [ ] Tests for the above in `lib/haskell/tests/parse-extras.sx` (≥ 8).
### Phase 18 — One ambitious conformance program
Pick something nontrivial that exercises feature interactions the small
suites miss; this is the only way to find unknown-unknown bugs.
- [ ] Choose a target. Candidates:
- **Tiny lambda-calculus interpreter** (~80 LOC): parser, eval, env,
test cases. Stresses ADTs + records + recursion + `IORef` for state.
- **Dijkstra shortest-path** on a small graph using `Data.Map` +
`Data.Set`. Stresses Map/Set correctness end-to-end.
- **JSON parser** (subset): recursive-descent, exception-on-error,
`Either ParseError Value` results. Stresses strings + Either + try.
- [ ] Adapt minimally; cite source as a comment.
- [ ] Add to `conformance.conf`; verify scoreboard stays green.
### Phase 19 — Conformance speed
The full suite re-pays the ~30 s cold-load cost per program; 36 programs ⇒
~25 minutes. Driving them all through one sx_server session would compress
that to single-digit minutes.
- [ ] In `conformance.sh` (and/or `lib/guest/conformance.sh`), batch all
suites into one process: load preloads once, then for each suite emit
an `(epoch N)` + `(load …)` + `(eval read-counters)` + `(eval reset-
counters)` block. Aggregate the per-suite results from the streamed
output.
- [ ] Make sure a single failing/hanging suite doesn't poison the rest —
per-suite timeout via a server-side guard, or fall back to per-process
on timeout.
- [ ] Verify the scoreboard output is byte-identical to the old per-process
driver, then keep the per-process path as `--isolated` for debugging.
## Progress log
_Newest first._