Skip to content

spike: W-010 session-type endpoint generation (#184) - #760

Open
tuyentn23-dot wants to merge 3 commits into
limitlessprojects:mainfrom
tuyentn23-dot:spike15-w010-session-projection
Open

tuyentn23-dot wants to merge 3 commits into
limitlessprojects:mainfrom
tuyentn23-dot:spike15-w010-session-projection

Conversation

@tuyentn23-dot

@tuyentn23-dot tuyentn23-dot commented Oct 19, 2026 •

Copy link
Copy Markdown

Spike for W-010 (#184): session-type endpoint generation

Standalone, dependency-free feasibility spike for the W-010 ledger slot
(slot 10, review window 2026-11-01). Pre-registered at
spikes/spike15-w010-session-projection/PREREG.md before the first
test run; results at RESULTS.md.

Hypothesis (preregistered)

For a closed subset (finite labelled message sequence + binary choice; no
recursion, no delegation, no dynamic spawn), if a global type G projects
to every role under Honda-Yoshida-Carbone projection with the standard
uninvolved-role merge condition, then the projected locals are
communication-deadlock-free (conditional on terminating local computation
and fair scheduling). Its contrapositive — the A/B ping-pong
A: send p; recv q / B: send q; recv p — cannot be synthesized into any
global type.

What is in the spike

model/ is a ~570-LOC Rust crate with zero dependencies:

  • Global / Local types, project, synthesize (inverse)
  • simulate_locals: exhaustive interleaving explorer that enumerates
    every schedule of enabled endpoints up to a bounded state count and
    distinguishes Terminates from Deadlock (with witness trace + stuck
    role set)
  • codegen_go: emits a hub-mediated Go skeleton (not run — see limits)

Results (actual, from RESULTS.md)

  • 8/8 tests pass on cargo test --release --offline, 4.87 s.
  • A/B ping-pong: synthesize returns Err(NoMatchingReceiver); the
    simulator reports Deadlock with both roles stuck. Prereg bar 2 met.
  • Request/reply: synthesize returns
    A -> B : p . B -> A : q . End, both projections round-trip, simulator
    reports Terminates. Prereg bars 3 and 4 met.
  • Three-role pipeline: synthesizes, terminates.
  • Three-role cross-cycle: rejected by synthesis, deadlocks in simulation.
  • Uninvolved-role merge: an identical branch projects fine; a divergent
    branch is rejected with UninvolvedBranchMerge.

No kill criterion fired.

Honest limits (stated in PREREG.md up-front, not retrofitted)

  • No Go toolchain on the author machine. I cannot run go build or
    go run here, so the codegen was validated by reading its actual output
    plus a protocol-level reasoning check against the projection. A reviewer
    with Go installed can now actually run it — see the
    model/work/{main.go,go.mod} that this PR commits:

    cd spikes/spike15-w010-session-projection/model/work
    go build ./...
    timeout 5 go run .
    

    Expected: PROTOCOL OK. (First revision of this PR had a broken codegen
    — the hub goroutine forwarded into its own channel; that is fixed in
    commit 6f183cb: per-role inbox channels, plus sync.Once around
    close(done) to avoid a double-close race between the timeout goroutine
    and the wg.Wait() goroutine. cargo test --release --offline is still
    8/8 after the fix. The correctness claim is the simulator, not the
    codegen; the codegen is a concrete, now-runnable illustration.)

  • No recursion, no delegation, no select-on-multiple-channels, no
    cancellation. All excluded by design.

  • Bounded state space (MAX_STATES = 20_000); beyond that the simulator
    returns DepthExceeded, never a safety verdict.

Relation to #184

The proposal's own "Bounded model evidence" section says its Python model
covers "the supplied finite acyclic graphs only" and does not parse
Go-Hybrid source, generate Go, or establish a future projection's
correctness. This spike closes part of that gap by mechanizing
synthesize <-> project round-trip and an exhaustive scheduler. It does
not claim to be a Go-Hybrid compiler change; it is a model of the
claim, in the same form as #370 and #381.

Files

  • PREREG.md — registered 2026-10-19, before first run
  • RESULTS.md — actual output, actual test counts
  • model/ — the crate (Cargo.toml, src/, tests/)

Refs #184 (W-010, MOONSHOT slot 10).

@limitlessprojects limitlessprojects added triage:new New arrival (<= 3 days old), awaiting recon triage:pareto Top-ranked land candidate for the next session triage:tests Includes test/corpus coverage labels Oct 19, 2026
@github-actions github-actions Bot added bot:stale-base Shepherd: behind main beyond threshold bot:conflict Shepherd: merge conflicts vs main labels Oct 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Shepherd W2 could not update this branch automatically (behind main by 76). Labeled bot:conflict — if the conflicts are docs-only (PLAN.md/STATUS.md) W5 resolves them deterministically; otherwise this needs a human.

PUT /repos/limitlessprojects/Go-Hybrid/pulls/760/update-branch -> 403 {"message":"refusing to allow a GitHub App to create or update workflow `.github/workflows/ci.yml` without `workflows` permission","documentation_url":"https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch","status":"403"}

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

Labels

bot:conflict Shepherd: merge conflicts vs main bot:stale-base Shepherd: behind main beyond threshold triage:new New arrival (<= 3 days old), awaiting recon triage:pareto Top-ranked land candidate for the next session triage:tests Includes test/corpus coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants