task core: re-key poisoning refusal onto the poison marker (#173) - #251
Merged
Conversation
Poisoning decisions now read the poisonedInstances marker, not the permanently-false mayEnter it shadows. New entryRefusal helper owns the entry-refusal decision (marker first with the #145 cause suffix, then the transient may_enter gate, byte-identical messages); the five trap gates (host entry, FACT sync/async start-call, enter-sync-call, dtor) route through it, and the two non-trap decisions (requestCancellation delivery, tick's candidate filter) take the marker as an added conjunct. The caller-is-callee vacuous pass of entering_set is preserved and pinned. Behavior-preserving under the current pin; the point is CM#705 (merged upstream): when the pin advance deletes may_enter, poisoning survives untouched because it no longer depends on it. Six white-box pins force mayEnter back to true on a marked instance to isolate the marker's authority; they must survive the removal unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First implementation PR of the #173 migration (CM#705 adoption), per the revised sequencing in #173 (comment) — pulled ahead of the pin advance because it is behavior-preserving under the current pin.
What
Poisoning (the runtime's named divergence: per-instance corpse semantics instead of store-fatal traps) is currently implemented as "
mayEnterstays false forever", with thepoisonedInstancesWeakMap as a diagnostic shadow (#145). CM#705 deletesmay_enterentirely, so this PR flips the dependency: every poisoning decision now reads the marker.entryRefusal(callee, caller, base)in task/scheduler.ts owns the entry-refusal decision: marker first (with the Go components trap (and poison their instance) when the Go runtime reads the clock inside cabi_realloc #145 cause suffix), then the transientmay_entergate (which CM#705 will delete wholesale),nullwhen enterable. Trap messages are byte-identical to the previouswithPoisonCausepattern in all three states; the doc comment carries the equivalence argument.Task.requestCancellation's delivery gate andStore.tick's candidate filter.entering_setvacuous pass (caller === callee) is preserved by an explicit guard and pinned — the dtor path is the live case.No bracket-break site, no
enterFrom/leaveTo/mayEnterFrom, and no already-marker-keyed site (dispatchableTail,resumeWith's early retire, streams retirement) is touched.Tests
Six white-box pins (
runtime/tests/task_test.ts, "Poisoning re-key") forcemayEnterback to true on a marked instance — a state the runtime never produces — to isolate the marker's authority. They must survive the CM#705 pin advance unchanged. All pre-existing pins pass unchanged.Gates
Full
just gatespass locally: core suites, conformance (1257 passed / 0 failed / 112 xfail, no stale xfails), sched-seeds, shells, browser lanes (chromium + firefox OK), smoke-tls, smoke-c0. Not breaking: no published-surface change, conventions goldens untouched.