phase-admission-carryover.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // The REPETITION CARVE-OUT in the phase copies' temporal admission, pinned.
  2. //
  3. // Admission normally asks "does some issue of the head in its phase sit after the first
  4. // issue of the tail in its phase". Inside a loop that question has a second answer: the
  5. // two sites share an enclosing iteration region, so iteration k's producer really does
  6. // feed iteration k+1's consumer even though the consumer's position is EARLIER. The
  7. // carve-out is what admits that, and it is mirrored from `realizableCarry` rather than
  8. // re-derived — one relation, one answer.
  9. //
  10. // Here the shared `probe` site is claimed by `open` (position first in every round) and by
  11. // `close`; the scout's pick, issued in `close`, is what the NEXT round's `open` probe reads
  12. // through `hint`. So:
  13. //
  14. // ask#1 -> world-read#1~phase#1 SURVIVES ONLY VIA THE CARVE-OUT — the open copy is
  15. // issued before ask#1 in walk order, and drop the shared-iteration clause and this
  16. // edge dies, taking a real loop-carried data dependency with it and leaving the two
  17. // phases looking concurrent. That is inventing concurrency, the one direction the
  18. // analysis may never take.
  19. // ask#1 -> world-read#1~phase#2 admitted by position, the ordinary case.
  20. /** The shared helper: one world-read site, called from both phases of every round. */
  21. async function probe(hint: string): Promise<string> {
  22. const log = await world.run("git", ["log", "-1", "--format=%s", "--grep", hint]);
  23. return log.stdout.trim();
  24. }
  25. const scout = agent("scout");
  26. let hint = "initial";
  27. let summary = "";
  28. for (let round = 0; round < 3; round++) {
  29. phase("open");
  30. // Reads what the PREVIOUS round's `close` picked — the loop-carried edge under test.
  31. const opening = await probe(hint);
  32. phase("close");
  33. const pick = await scout.ask<string>(`Given "${opening}", name the next commit to read.`);
  34. summary = await probe(pick);
  35. hint = pick;
  36. }
  37. return summary;