Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
fa26739
SH Track 1 Tier 0: literal Int -> main exit code
claude Apr 30, 2026
f08a2fa
SH Track 1 Tier 1: Int arithmetic on the @main exit-code path
claude Apr 30, 2026
a89a4b7
SH Track 1 Tier 2: top-level functions, m0 erasure, closure-rejecting
claude Apr 30, 2026
db4faec
SH Track 1: fix two bugs surfaced by local Racket v9.0 validation
claude Apr 30, 2026
872b20d
SH Track 2 Tier 3 C1: foundation (Bool, comparisons, multi-block, let)
claude May 1, 2026
826dfc1
SH Track 2 Tier 3 C2: conditional lowering (boolrec + reduce-on-Bool)
claude May 1, 2026
68a8d4e
SH Track 2 Tier 3 C3: recursion (fact, fib, sum-to) + CI
claude May 1, 2026
c92a09e
SH Track 3 N0 plan doc: network-shaped lowering, Zig kernel
claude May 1, 2026
b62023f
SH Track 3 N0: network-shaped lowering, Zig kernel, 3/3 acceptance
claude May 1, 2026
ee0e3cb
SH Track 3 N0: fix CI — extern abort + diagnostic build steps
claude May 1, 2026
157605e
SH Track 3 N0: build Zig kernel with -OReleaseFast
claude May 1, 2026
ba4d3d9
SH Track 3 N0: fix CI — add -fPIC to zig build-obj
claude May 1, 2026
5dd8524
Ignore network-lowering build artifacts (runtime/*.o)
claude May 1, 2026
923acd2
SH Track 3 N0: smoke-test must guard against bash -e
claude May 1, 2026
00a4698
sh: annotate N0 plan doc against formal SH master tracker
claude May 1, 2026
cb95b3f
sh: alignment-delta doc — shipped work vs formal SH series tracks
claude May 1, 2026
5337d54
sh/track1: .pnet format-2 versioned wrapper (additive, backward-compat)
claude May 1, 2026
57ad0f3
sh/track6: persistent HAMT in Zig (Issue #42 Path A)
claude May 1, 2026
8373516
sh/track1: fire-fn-tag field on propagator struct (additive)
claude May 1, 2026
1e709f3
sh/track2: Low-PNet IR design doc
claude May 1, 2026
68849b6
sh/track1: fix test-source-loc-infrastructure for new fire-fn-tag field
claude May 1, 2026
465f070
sh/track2 phase 2.A: Low-PNet IR data structures + parse + pp + validate
claude May 1, 2026
6930afd
sh/track1 audit: fire-fn tag categorization + first runtime-tagged site
claude May 1, 2026
d08bd76
chore: untrack racket/prologos/data/cache/pnet/prologos/data/nat.pnet
claude May 1, 2026
941b5c5
sh/track2 phase 2.B: prop-network → Low-PNet IR
claude May 1, 2026
9f42a51
sh/track1: deployment-mode .pnet serializer (assert-no-untagged enfor…
claude May 1, 2026
c9f164b
sh/track1+2: cell-value marshaling — real init-values in Low-PNet
claude May 1, 2026
1f0bbb5
sh/track2 phase 2.C: Low-PNet IR → LLVM IR
claude May 1, 2026
b02b6f6
sh: pnet-compile.rkt — end-to-end .prologos → .pnet → binary
claude May 1, 2026
884af52
sh/track1: domain-registry pass — real bot values + CI for pnet-compile
claude May 1, 2026
859680c
sh: pnet-compile CI step — guard against bash -e on intentional non-z…
claude May 1, 2026
f32a966
sh/track4: extend Zig kernel with propagator install + scheduler
claude May 1, 2026
9c76846
sh/track2 phase 2.D: lower propagator-decls to kernel install + sched…
claude May 1, 2026
f77ffdc
sh/track2 phase 2.E: AST → propagator-network translator + arith e2e
claude May 1, 2026
ad21e0e
sh/track2: ast-to-low-pnet — add let-binding (expr-app + expr-lam + e…
claude May 1, 2026
b15eb1e
sh/bench: gen-fib + pnet-bench — long-running payload achieved
claude May 1, 2026
cc28728
sh/sprint-A: comparisons + select propagator — conditional dataflow o…
claude May 1, 2026
4596daa
sh/sprint-B+C: native BSP scheduler + instrumentation
claude May 1, 2026
6c02c60
sh/perf-diagnostics: wall time + per-tag time + auto-emit + bench har…
claude May 1, 2026
5590976
sh/sprint-E.1+E.2: kernel-identity (1,1) propagator + BSP feedback va…
claude May 1, 2026
898949c
sh/sprint-E.3: tail-recursive defn lowering — source-level iterative …
claude May 1, 2026
51a13df
sh/bench: gen-iter + bench-suite — sweep unrolled vs iterative across N
claude May 1, 2026
040de54
sh/design: feature map + dependency graph for AST → propagator-networ…
claude May 1, 2026
652b0f0
sh/sprint-F.1: non-recursive function inlining at lowering time
claude May 1, 2026
a03d605
sh/sprint-F.2: non-dependent pair lowering
claude May 1, 2026
3a02341
sh/sprint-F.3: pair-typed state in tail-rec lowering
claude May 1, 2026
6523a78
sh/sprint-F.4: Nat match + zero/suc/nat-val lowering
claude May 1, 2026
d7bc181
sh/bench: 5 new algorithms in Prologos source + showcase + pell-limit…
claude May 1, 2026
42ea729
sh/sprint-F.5: lag-matching bridges fix mixed-depth step expressions
claude May 1, 2026
cc43559
sh/bench: re-enable pell + 4 wall-time-focused output tables
claude May 2, 2026
05dd2dc
sh/research: depth-alignment in BSP propagator networks (synthesis + …
claude May 2, 2026
7757cd0
sh/sprint-F.6: retiming pass — bridge coalescing + depth-balance inva…
claude May 2, 2026
9f70c5a
sh/research: revision 2 — collaborator critique on CALM + stratification
claude May 2, 2026
694edd7
sh/sprint-G: design doc + Phase 1 IR (iter-block-decl) + builder field
claude May 2, 2026
5a2ea70
sh/research: kernel-level Pocket Universes design doc (5 options for …
claude May 2, 2026
f8ca173
sh/research: kernel PU design doc — 7 deltas from concurrency-substra…
claude May 2, 2026
e2e0215
sh/preduce: MVP design doc — AST → executable propagator network
claude May 2, 2026
53dc7e8
sh/preduce: defer expr-foreign-fn from MVP scope
claude May 2, 2026
d2a0186
sh/preduce-lite: incorporate user decisions on 6 design points
claude May 3, 2026
1f04280
sh/preduce-lite: codify correctness > simplicity > performance priori…
claude May 3, 2026
f86ea8f
sh/preduce-lite: Phase 0 acceptance file (7 programs)
claude May 3, 2026
13392d4
sh/preduce-lite: Phase 1 — skeleton lands
claude May 3, 2026
3f15dd7
sh/preduce-lite: Phase 2 — literals + arithmetic + ann + pairs
claude May 3, 2026
218a080
sh/preduce-lite: Phase 3 — static β, lambda values, fvar inlining
claude May 3, 2026
7f417a6
sh/preduce-lite: Phase 4 — dynamic β via fire-once on function position
claude May 3, 2026
3245e69
sh/preduce-lite: Phase 5 — eliminators (boolrec, natrec, J)
claude May 3, 2026
509fc1b
sh/preduce-lite: Phase 6 — Vec eliminators + Fin family
claude May 3, 2026
fbb132f
sh/preduce-lite: Phases 7+8 — atomic literals (string/char/kw/sym/pat…
claude May 3, 2026
b34ec90
sh/preduce-lite: Phase 10 — expr-reduce (built-in constructors); fore…
claude May 3, 2026
6fa7921
ci-fix: skip test-sre-sd-properties pending SRE Track 2I Phase 4
claude May 3, 2026
9548f03
sh/preduce-lite: Phases 11+13+14 (value-tokens opaque) + Phase 10 pat…
claude May 3, 2026
9fecdd5
sh/preduce-lite: Phases 12 (postponed), 15 (gate green), 16 (validate…
claude May 3, 2026
d73dc54
ci-fix: skip 3 pre-existing CI failures (rackcheck-deps + batch-order…
claude May 3, 2026
121f1a0
ci: install rackcheck explicitly + un-skip the 2 rackcheck-dependent …
claude May 3, 2026
8319f2f
sh/preduce-lite: Phase 11b — simple container ops (Map, Set, PVec)
claude May 3, 2026
f285915
sh/preduce-lite: Phase 14b — tail edges (numeric coercion + cut opaqu…
claude May 3, 2026
83f6cb6
sh/preduce-lite: Phase 15b — extended differential gate (natrec + nes…
claude May 3, 2026
2e03664
sh/preduce-lite: PIR (16-question template + longitudinal survey)
claude May 3, 2026
b5261e4
research: hybrid Racket-Zig runtime — Stage 1 sprint synthesis
claude May 3, 2026
52fc5cf
research: hybrid Racket-Zig runtime — Stage 2 calibration + Stage 3 d…
claude May 4, 2026
e12c63d
sh/hybrid-runtime: Phase 1 + 3 + 4 — shared core + hybrid kernel + C …
claude May 4, 2026
ff5cb86
sh/hybrid-runtime: Phase 6 + 7 + 8 — Racket bridge, handle table, thr…
claude May 4, 2026
f7b8420
ci: gitignore .so build artifacts + smoke-test binary
claude May 4, 2026
92655b5
ci: hybrid runtime — fail-soft bridge + skip gate + Zig build step
claude May 4, 2026
240f905
sh/hybrid-runtime: Phase 9 — raco distribute packaging (working bundle)
claude May 4, 2026
0535184
sh/hybrid-runtime: Phase 8b — expand preduce-hybrid + fix stat-key ra…
claude May 4, 2026
06ce222
sh/hybrid-runtime: Phase 10 — first profile-driven migration (identit…
claude May 4, 2026
5c89aad
ocapn: import compatibility targets from upstream PR #28
claude May 4, 2026
d296870
preduce: Phase 10b — user-defined-ctor expr-reduce dispatch
claude May 4, 2026
80bb874
docs: PReduce-lite consolidated PIR + roadmap updates
claude May 4, 2026
56a4a98
docs: Hybrid Racket-Zig Runtime PIR + roadmap updates
claude May 4, 2026
c54e702
docs: hybrid runtime PIR — correct BSP-scheduler-in-core inaccuracy
claude May 4, 2026
676f622
docs: PReduce-lite PIR — correct numeric inaccuracies from code-vs-cl…
claude May 4, 2026
28465e3
docs: design plan — swappable backend refactor for preduce-lite + hybrid
claude May 4, 2026
ae26bc5
docs: backend-refactor plan — flip to Option A (functional threading …
claude May 4, 2026
0d80dfa
preduce-core: Phase 1 — backend interface skeleton
claude May 4, 2026
0ac9ba8
preduce-core: Phase 2 — preduce.rkt rewritten through backend interface
claude May 4, 2026
2d6817f
preduce-core: Phase 4 — backend-hybrid + compile-expr now runs on the…
claude May 4, 2026
4ae1204
preduce-core: Phase 5+6 — Phase-10b workload runs end-to-end on the Z…
claude May 4, 2026
b5044a9
preduce-hybrid: rewrite as thin wrapper around shared compile-expr
claude May 4, 2026
fab2cb0
preduce-core: benchmark — OCapN-shape workloads on lite vs hybrid kernel
claude May 4, 2026
88c47f4
bench: add W5 int-arith workload — surfaces native-dispatch regression
claude May 4, 2026
6ea73cc
preduce-core: fix native-dispatch regression — #:native-op hint on in…
claude May 4, 2026
f00fdb7
docs: PIR updates — encode the swappable-backend refactor + native-di…
claude May 4, 2026
e448970
ocapn: parallel-branch coordination + first OCapN-on-kernel program
claude May 4, 2026
0ae1230
ocapn-on-kernel: 5 programs validated end-to-end + FormatBuffer fix
claude May 4, 2026
d1d76a3
ocapn-on-kernel: 3 more programs + pitfalls tracking doc
claude May 4, 2026
236e441
ocapn-on-kernel: programs 9 + 10 — recursion + arity-4 CapTP message
claude May 4, 2026
57f2bc8
docs: PIR for the swappable-backend refactor
claude May 4, 2026
9f2dd98
ocapn: pull tier-B lib + tests from upstream branch; 2 new hybrid pro…
claude May 4, 2026
b9a5f27
hybrid-kernel: Phase 7 migration target data (no impl)
claude May 5, 2026
13e161e
gitignore: ignore stray .../ cache dir from bundle
claude May 5, 2026
93c9eaf
hybrid-battery: 46-program shape battery + Phase 7 data refresh
claude May 5, 2026
3af686e
hybrid-workloads: 15 broad non-trivial workloads + Phase 7 doc refresh
claude May 5, 2026
b205134
hybrid-kernel: root-cause W14 failure as callback BSP-violation bug
claude May 5, 2026
face18f
hybrid-kernel: fix plan for callback BSP-violation bug (no impl)
claude May 5, 2026
9cea3d2
hybrid-kernel: fix callback BSP-violation bug + R1-R5 regression test…
claude May 5, 2026
99703e9
hybrid-kernel: Fix C — BSP-correct callback fire-fns (snapshot reads …
claude May 5, 2026
3ba749a
hybrid-kernel: fix stat-key aliasing after N_TAGS bump (CI test failure)
claude May 5, 2026
a08b691
hybrid-runtime PIR: Appendix C — BSP-violation bug + Fix C postscript
claude May 5, 2026
28746f1
hybrid-kernel: migrate int-mod to native (kernel tag 7)
claude May 5, 2026
4953744
hybrid-kernel: native fire-fns must guard against TAG_BOT inputs
claude May 6, 2026
5fd8e3c
phase7: future-work code-size evaluation (Racket vs Zig kernel)
claude May 6, 2026
4cbe354
hybrid-kernel: consolidate Phase 7+ future-work eval into existing doc
claude May 6, 2026
087df4a
tools: add bench-ocapn-suite — wall-time comparison: nf / whnf / hybrid
claude May 6, 2026
66c9b15
ocapn: parity sync with upstream HEAD (b971818) — 20 tests / 145 cases
claude May 6, 2026
16587df
ci: skip slow OCapN tests + pull tools/interop sources
claude May 6, 2026
3bf06d6
ci: install Node + OCapN interop deps; skip OCapN-FFI tests pending e…
claude May 6, 2026
3aa987f
ocapn: fix pitfall #22 + add string::bytes-length; 6 FFI tests pass
claude May 6, 2026
802ff10
docs: bridge-interop perf — root-cause to Phase 7 #1 (recursive call)
claude May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
59 changes: 59 additions & 0 deletions .github/workflows/llvm-lower.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: LLVM Lowering

on:
push:
branches: [main, "claude/**"]
pull_request:

jobs:
llvm-lower:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v4

- name: Install Racket
uses: Bogdanp/setup-racket@v1.11
with:
version: '9.0'

- name: Verify clang is available
run: |
clang --version
which clang

- name: Install Prologos package dependencies
run: cd racket/prologos && raco pkg install --auto --skip-installed

- name: Pre-compile compiler + lowering module
run: |
cd racket/prologos
raco make driver.rkt
raco make llvm-lower.rkt

- name: Pre-compile test runner
run: raco make tools/llvm-test.rkt tools/llvm-compile.rkt

- name: Tier 0 unit tests (IR string assertions)
run: cd racket/prologos && raco test tests/test-llvm-lower.rkt

- name: Tier 0 end-to-end (lower + clang + run)
env:
PROLOGOS_LLVM_TIER: "0"
run: racket tools/llvm-test.rkt --tier 0 racket/prologos/examples/llvm/tier0

- name: Tier 1 end-to-end (lower + clang + run)
env:
PROLOGOS_LLVM_TIER: "1"
run: racket tools/llvm-test.rkt --tier 1 racket/prologos/examples/llvm/tier1

- name: Tier 2 end-to-end (lower + clang + run)
env:
PROLOGOS_LLVM_TIER: "2"
run: racket tools/llvm-test.rkt --tier 2 racket/prologos/examples/llvm/tier2

- name: Tier 3 end-to-end (lower + clang + run)
env:
PROLOGOS_LLVM_TIER: "3"
run: racket tools/llvm-test.rkt --tier 3 racket/prologos/examples/llvm/tier3
297 changes: 297 additions & 0 deletions .github/workflows/network-lower.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
name: Network Lowering (N-series)

on:
push:
branches: [main, "claude/**"]
pull_request:

jobs:
network-lower:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v4

- name: Install Racket
uses: Bogdanp/setup-racket@v1.11
with:
version: '9.0'

- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Verify clang is available
run: |
clang --version
which clang

- name: Install Prologos package dependencies
run: cd racket/prologos && raco pkg install --auto --skip-installed

- name: Pre-compile compiler + network passes
run: |
cd racket/prologos
raco make driver.rkt
raco make network-emit.rkt
raco make network-lower.rkt

- name: Pre-compile network tools
run: raco make tools/network-compile.rkt tools/network-test.rkt

- name: Zig HAMT unit tests
# SH Track 6 sub-piece (Issue #42 Path A). Zig-internal `test`
# blocks in runtime/prologos-hamt.zig. Requires libc for the
# extern abort symbol (test mode does not auto-link libc).
run: zig test -lc runtime/prologos-hamt.zig

- name: Build Zig HAMT object
run: |
zig build-obj runtime/prologos-hamt.zig \
-OReleaseFast -fstrip -fPIC \
-femit-bin=runtime/prologos-hamt.o
ls -la runtime/prologos-hamt.o

- name: HAMT C-ABI smoke test
# Validates that the .o links cleanly against a non-Zig caller.
run: |
clang runtime/test-hamt.c runtime/prologos-hamt.o -o /tmp/test-hamt
/tmp/test-hamt

- name: Build Zig kernel
run: |
zig version
# -OReleaseFast: omit bounds/overflow safety checks. Our explicit
# bounds checks already cover the boundary; without ReleaseFast,
# implicit checks emit calls into Zig's panic handler that
# zig build-obj does not include in the .o, leaving unresolved
# symbols when clang links against plain libc.
# -fstrip: drop debug info to keep the .o minimal.
# -fPIC: produce position-independent code. Modern clang on Linux
# links PIE executables by default; non-PIC objects fail with
# "relocation R_X86_64_32S against `.bss' can not be used when
# making a PIE object". -fPIC is the standard fix.
zig build-obj runtime/prologos-runtime.zig \
-OReleaseFast -fstrip -fPIC \
-femit-bin=runtime/prologos-runtime.o
ls -la runtime/prologos-runtime.o
file runtime/prologos-runtime.o
echo "--- exported symbols (T = strong, U = undefined) ---"
nm runtime/prologos-runtime.o || true
echo "--- undefined symbols only (should be only abort + maybe libc-internals) ---"
nm -u runtime/prologos-runtime.o || true

- name: Smoke-test runtime linkage with a minimal IR
run: |
cat > /tmp/smoke.ll <<'EOF'
declare i32 @prologos_cell_alloc()
declare i64 @prologos_cell_read(i32)
declare void @prologos_cell_write(i32, i64)
define i64 @main() {
entry:
%c = call i32 @prologos_cell_alloc()
call void @prologos_cell_write(i32 %c, i64 99)
%v = call i64 @prologos_cell_read(i32 %c)
ret i64 %v
}
EOF
clang /tmp/smoke.ll runtime/prologos-runtime.o -o /tmp/smoke
# GitHub Actions runs `bash -eo pipefail`. /tmp/smoke is *expected*
# to return non-zero (the cell value as exit code). Without disabling
# -e around the call, set -e treats the expected return as a failure
# and the step exits with the smoke binary's exit code BEFORE the
# explicit `test` check runs.
set +e
/tmp/smoke
ec=$?
set -e
echo "smoke exit code: $ec"
test "$ec" -eq 99

- name: BSP scheduler + instrumentation smoke test
# Sprint B+C (2026-05-01). Validates run_to_quiescence runs proper
# BSP rounds (snapshot/diff/merge), the (3,1) select propagator
# works, and the prologos_get_stat / prologos_reset_stats /
# prologos_set_max_rounds interfaces match the kernel's exports.
run: |
clang runtime/test-bsp-stats.c runtime/prologos-runtime.o \
-o /tmp/test-bsp-stats
/tmp/test-bsp-stats

- name: BSP feedback smoke test (Sprint E)
# Sprint E (2026-05-01). Validates the (1,1) shape (kernel-identity)
# and that the BSP barrier keeps reads/writes consistent under
# cyclic networks. Includes iterative fib(0..20) computed by a
# gated self-feedback loop — the same algorithm a future
# source-level expr-iterate would lower to.
run: |
clang runtime/test-bsp-feedback.c runtime/prologos-runtime.o \
-o /tmp/test-bsp-feedback
/tmp/test-bsp-feedback

- name: N0 end-to-end (lower + clang + run)
env:
PROLOGOS_NETWORK_TIER: "0"
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: racket tools/network-test.rkt --tier 0 racket/prologos/examples/network/n0

- name: pnet-compile end-to-end (.prologos → .pnet → .ll → binary)
# SH milestone: full pipeline through Track 1's deployment-mode
# .pnet artifact format (instead of N0's network-skeleton).
# Validates the formal SH track structure end-to-end.
# Note on `|| ec=$?`: racket exits with the program's exit code
# (e.g. 7 for exit-7.prologos), which is the expected non-zero
# return. Without the || guard, GitHub Actions' bash -e treats
# the non-zero racket exit as step failure before our test check.
env:
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: |
raco make tools/pnet-compile.rkt
for f in 0 7 42; do
ec=0
racket tools/pnet-compile.rkt -o /tmp/test-pnet-$f \
racket/prologos/examples/network/n0/exit-$f.prologos > /dev/null 2>&1 || ec=$?
echo "exit-$f.prologos → racket exit=$ec (expected $f)"
test "$ec" -eq "$f"
done

- name: pnet-compile arithmetic end-to-end (n1-arith)
# Phase 2.D: arithmetic programs compile to a propagator network
# via .pnet, with kernel-int-add/sub/mul/div fire-fns dispatched
# by the in-kernel scheduler. 6 acceptance programs covering
# add, sub, mul, div, nested, and deeply-nested arithmetic.
env:
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: |
for f in racket/prologos/examples/network/n1-arith/*.prologos; do
expected=$(grep -oE ':expect-exit -?[0-9]+' "$f" | grep -oE '\-?[0-9]+')
ec=0
racket tools/pnet-compile.rkt -o /tmp/n1-arith-test \
"$f" > /dev/null 2>&1 || ec=$?
echo "$(basename $f) → exit=$ec (expected $expected)"
test "$ec" -eq "$expected"
done

- name: pnet-compile tail-recursive iteration (n2-tailrec)
# Sprint E.3 (2026-05-01). Tail-recursive defn forms are
# recognized by ast-to-low-pnet's `match-tail-rec` and lowered
# to a feedback propagator network — the same shape as
# test-bsp-feedback.c's hand-rolled iterative fib, but generated
# from regular Prologos source. Programs use 9-12 cells + 7-10
# propagators independent of input size; networks self-terminate
# via the cond gate (no fuel needed).
env:
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: |
for f in racket/prologos/examples/network/n2-tailrec/*.prologos; do
expected=$(grep -oE ':expect-exit -?[0-9]+' "$f" | grep -oE '\-?[0-9]+')
ec=0
racket tools/pnet-compile.rkt -o /tmp/n2-tailrec-test \
"$f" > /dev/null 2>&1 || ec=$?
echo "$(basename $f) → exit=$ec (expected $expected)"
test "$ec" -eq "$expected"
done

- name: pnet-compile non-recursive helpers (n3-helpers)
# Sprint F.1 (2026-05-01). Non-recursive helper functions are
# inlined at lowering time via beta-substitution: when an
# `(expr-app^k (expr-fvar f) args)` doesn't match the tail-rec
# pattern, look up f's body and substitute it for the fvar.
# Falls through to the multi-arg beta-redex handler. Self-
# recursive non-tail-rec forms error cleanly; mutual recursion
# caught by depth limit (MAX-INLINING-DEPTH=64).
env:
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: |
for f in racket/prologos/examples/network/n3-helpers/*.prologos; do
expected=$(grep -oE ':expect-exit -?[0-9]+' "$f" | grep -oE '\-?[0-9]+')
ec=0
racket tools/pnet-compile.rkt -o /tmp/n3-helpers-test \
"$f" > /dev/null 2>&1 || ec=$?
echo "$(basename $f) → exit=$ec (expected $expected)"
test "$ec" -eq "$expected"
done

- name: pnet-compile non-dependent pairs (n4-pairs)
# Sprint F.2 (2026-05-01). Non-dependent pair lowering. build
# returns a value-tree (cell-id for scalars, list for pairs).
# expr-pair allocates per-component; expr-fst/expr-snd project.
# Per-component decomposition flows transparently through let-
# binding and conditional select. Helpers can take and return
# pair-typed values. Scope is simply-typed pairs only —
# dependent Sigma is intentionally excluded (per collaborator
# feedback 2026-05-01).
env:
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: |
for f in racket/prologos/examples/network/n4-pairs/*.prologos; do
expected=$(grep -oE ':expect-exit -?[0-9]+' "$f" | grep -oE '\-?[0-9]+')
ec=0
racket tools/pnet-compile.rkt -o /tmp/n4-pairs-test \
"$f" > /dev/null 2>&1 || ec=$?
echo "$(basename $f) → exit=$ec (expected $expected)"
test "$ec" -eq "$expected"
done

- name: pnet-compile pair-typed iteration state (n5-pair-state)
# Sprint F.3 (2026-05-01). Extends tail-rec lowering to support
# pair-typed state slots. literal-init-value recurses through
# expr-pair (so [pair 0 1] becomes a vtree of literals).
# State allocation, cond, step-args, and feedback all walk the
# vtrees per-leaf. Bridge logic for shared state cells operates
# per-leaf as well. fib via <a*b> pair state produces identical
# metrics to the 3-scalar fib-iter, confirming the per-leaf
# decomposition is equivalent.
env:
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: |
for f in racket/prologos/examples/network/n5-pair-state/*.prologos; do
expected=$(grep -oE ':expect-exit -?[0-9]+' "$f" | grep -oE '\-?[0-9]+')
ec=0
racket tools/pnet-compile.rkt -o /tmp/n5-pair-state-test \
"$f" > /dev/null 2>&1 || ec=$?
echo "$(basename $f) → exit=$ec (expected $expected)"
test "$ec" -eq "$expected"
done

- name: pnet-compile Nat match (n6-nat-match)
# Sprint F.4 (2026-05-01). expr-zero / expr-suc / expr-nat-val
# lower to Int cells (Nat is i64 at runtime). Two-arm match
# `match n | zero -> z-body | suc m -> s-body` lowers to a
# cascaded select gated on (int-eq scrut 0); the suc arm's
# binder `m` becomes a cell holding (scrut - 1) pushed onto
# env. Multi-arm (>2) match for general sum types is deferred
# — needs tagged-union runtime representation.
env:
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: |
for f in racket/prologos/examples/network/n6-nat-match/*.prologos; do
expected=$(grep -oE ':expect-exit -?[0-9]+' "$f" | grep -oE '\-?[0-9]+')
ec=0
racket tools/pnet-compile.rkt -o /tmp/n6-nat-match-test \
"$f" > /dev/null 2>&1 || ec=$?
echo "$(basename $f) → exit=$ec (expected $expected)"
test "$ec" -eq "$expected"
done

- name: pnet-compile combined-features showcase (n7-showcase)
# Single Prologos program exercising every Sprint A-F.4 feature
# together: int arith + comparison (A), tail-recursive defn
# (E.3), non-recursive helper inlining (F.1), pair construction
# + projection (F.2), pair-typed iteration state (F.3).
# Same fib(10)=55 result as the simpler iterative variants,
# validating that feature composition produces the expected
# minimal network (12 cells, 10 props, 32 BSP rounds).
env:
PROLOGOS_RUNTIME_OBJ: "runtime/prologos-runtime.o"
run: |
for f in racket/prologos/examples/network/n7-showcase/*.prologos; do
expected=$(grep -oE ':expect-exit -?[0-9]+' "$f" | grep -oE '\-?[0-9]+')
ec=0
racket tools/pnet-compile.rkt -o /tmp/n7-showcase-test \
"$f" > /dev/null 2>&1 || ec=$?
echo "$(basename $f) → exit=$ec (expected $expected)"
test "$ec" -eq "$expected"
done
Loading
Loading