Skip to content

driver: stale settled entry, poisoned-probe spin, corpse settlements, exception-exit hand-off (review) - #301

Merged
lannbot merged 1 commit into
mainfrom
fix/review-driver
Sep 7, 2026
Merged

driver: stale settled entry, poisoned-probe spin, corpse settlements, exception-exit hand-off (review)#301
lannbot merged 1 commit into
mainfrom
fix/review-driver

Conversation

@lannbot

@lannbot lannbot commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Adversarial correctness review of main @ 396a216, driver track. Four confirmed findings in the export-call driver plus one cheap hazard, each pinned by a store-level regression test that fails on the pre-fix tree.

Finding Severity Test
F1 P5 race-winner path leaves the consumed settlement in store.settled; a synchronous re-park inside resumeWith gets the OLD value delivered against the NEW promise (double resume) HIGH driver_stale_settled_test.ts
F2 Deadlock probe consults unfiltered readyCandidates() while tick filters poisoned instances → driver re-arms every macrotask forever instead of trapping HIGH driver_poisoned_probe_test.ts
F3 A poisoned instance's outstanding async import settles into the corpse: results lowered into its memory, a rejection parked on store.hostFailure fails a healthy sibling's next call (contra arch §6 #173) MEDIUM poisoned_host_call_retire_test.ts
F4 Exception exits are not exits: drive's throw path skips the settlement pump; driveAsync's trap exit leaves a sibling hop-park queued in store.settled (the #280 trace via the trap path) MEDIUM driver_trap_exit_liveness_test.ts (2 tests)
F6 Speculative addPendingResumption(chosen) collapses with a genuine entry; finally removes the only one LOW

Mechanisms are in the commit message. Authorities: definitions.py canon_lift/Store.tick/Thread.resume; docs/architecture.md §6 (one driver per store, #173).

Gates: just test-runtime 723/0; just conformance 1511 commands / 0 failed / 0 stale; just sched-seeds green; full just gates green on the union of the five review PRs.

Automerge armed. Sibling PRs from the same review: wait_until pending-cancel, transcoder u32, built-in index u32, host pump trap. Related open issues from the same track: #294 (F5, unconfirmed).

…in, corpse settlements, exception-exit hand-off

Adversarial correctness review of the export-call driver (boundary.ts) and
its store-level helpers, judged against definitions.py's single-loop
`canon_lift`/`Store.tick` model and arch §6. Each finding was confirmed by a
store-level regression test that fails on the pre-fix tree.

- F1 one settlement, one delivery. `noteAwaiting` records a settlement into
  `store.settled` EAGERLY; the P5 race-winner path then called `resumeWith`
  directly and left that entry queued. A body that re-parks synchronously
  inside `resumeWith` (a `waitUntil` returning without yielding on a
  pending cancel) is back in `awaiting` when the next `serviceSettled`
  runs, so the OLD value was delivered against the NEW park. The winner
  site now splices the thread's queued entries before resuming.
  (driver_stale_settled_test.ts)
- F2 the deadlock probe's "a thread became READY" branch consulted
  `store.readyCandidates()` unfiltered while `tick` filtered poisoned
  instances, so a ready thread of a corpse made the probe re-arm every
  macrotask instead of trapping — silent hang plus CPU spin. The poison
  filter moves into `readyCandidates`; `tick`'s copy is deleted.
  (driver_poisoned_probe_test.ts)
- F3 a poisoned instance's outstanding async import settled into the corpse:
  a fulfilment lowered results into its memory (possibly re-entering its
  realloc), a rejection parked on `store.hostFailure` and failed the next
  driver — a HEALTHY sibling's export call, contra arch §6 #173. The settle
  continuation's renounced-call guard now also covers a poisoned lowering
  instance. (poisoned_host_call_retire_test.ts)
- F4 exit by exception is still an exit. `drive`'s throw path skipped
  `ensureSettlementPump`, orphaning a sibling's in-flight host call;
  `driveAsync`'s trap exit armed the pump only on real host calls, leaving
  a sibling's hop-park queued in `store.settled` where it gates every later
  driver's `tick` (#280's trace via the trap exit). `drive` hands off on
  throw; the pump's work predicate covers queued tails and hop-parked
  threads, racing the hop promises alongside the host calls.
  (driver_trap_exit_liveness_test.ts)
- F6 the speculative `addPendingResumption(chosen)` collapsed with a genuine
  entry for the same thread (Set by identity) and the `finally` removed the
  only one; recorded as added only when this driver added it.

Baseline 702 → 723 passed; conformance 1511 commands / 0 failed / 0 stale;
sched-seeds green.
@lannbot
lannbot enabled auto-merge September 7, 2026 02:12
@lannbot
lannbot merged commit 246cfe1 into main Sep 7, 2026
3 checks passed
@lannbot
lannbot deleted the fix/review-driver branch September 7, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants