Repository navigation
test(core): model ready() publication sequence in LC-06 history (#248) - #256
Merged
Merged
Conversation
ReadyHistoryModel now packs the Fiber state with its total publication
sequence, mirroring StatePublication::{publish,observe,sequence}, and
try_ready_acceptance follows production ready()'s order: observe
(state, sequence), idle / committed-recheck test, sequence recheck,
answer.
A new restart history races one complete restart-like pass (claim ->
publish transient -> publish stable -> release) against one ready actor.
Its oracle rejects a transient answer and any answer whose publication
was not current at a quiescent point inside the invocation.
ready_without_sequence_recheck_is_detected removes the recheck and Loom
finds the transient answer from the Tokio regression
ready_transient_state_racing_complete_restart_never_panics.
lc06_model bounds (max_threads = 3, max_branches = 64) are unchanged.
The modeling doc drops the #248 not-represented entry and describes both
LC-06 histories; the review guide LC-06 row adds the sequence recheck,
the new model and negative control, and the Tokio regression.
Closes #248
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #248
Summary
ReadyHistoryModel(crates/cordis-core/tests/loom_inertia.rs) now packs the Fiber state with its total publication sequence into one SeqCst word. This mirrorsStatePublication's single mutex:publishis one read-modify-write, including production's no-op for an unchanged state, andobserveis one load.try_ready_acceptancefollows productionready()'s order: observe (state, sequence), the idle / committed-recheck test, the sequence recheck, then the answer. Each model step cites the production lines it maps.ready_answer_survives_a_complete_racing_restart_pass): one restart-like pass (claim -> publish transientLoading-> publish stableActive-> release) races one ready actor. The whole pass can land between ready's state read and its idle recheck. The Layer-C counterpart isready_transient_state_racing_complete_restart_never_panics.assert_ready_answer_had_quiescent_point): a ready answer is stale unless the answered publication was current at a point inside the invocation[I, R]where the Fiber was quiescent. Each publication's quiescent window[q, e)must meet[I, R]. Thee > Iside is exact: the answer's sequence must be at least the sequence read at invocation. Forq <= R, the restart records the final publication's bit before its releasing CAS, so the window it records can only be wider than the real one. A transient answer is checked first and fails with its own message.ready_without_sequence_recheck_is_detected): the same history without the sequence recheck. It fails withshould_panic(expected = "stale ready answer: transient state escaped ready"), which is the oracle's own message. Loom finds the schedule from the Tokio regression. As a temporary probe that is not committed, I disabled the transient check; the window check alone then rejected the same answer (StatePublication { state: 2, sequence: 1 } was not current at any quiescent point inside the invocation).ready_return_has_a_quiescent_linearization_point/ready_that_treats_idle_as_quiescent_is_detectedkeep their oracle and still pass and fail as before.UnloadingandLoadingare collapsed into one transient publication.lc06_modelbounds are unchanged (max_threads = 3,max_branches = 64, no permutation/duration cap). Thetwo_mutatorsection andtwo_mutations_preserve_revision_inspection_coverageare untouched.lifecycle-concurrency-modeling.md, the Loom: model ready() publication sequence in ReadyHistoryModel (LC-06) #248 entry is removed from the not-represented list, the LC-06 section describes both histories, and the Phase 1 scenarios bounds sentence now says "models". This PR does not touch the Era offer/accept bullet or the ER-07 note (Loom: split Era handoff into offer / accept / cancel-after-offer #247). Inlifecycle-concurrency-review-guide.md, the LC-06 row now covers the sequence recheck, the new model and negative control, andready_transient_state_racing_complete_restart_never_panics.Test/model and docs only. No production code or public API change.
Gates (
ci/gates.sh t248)I did not run the
test,examplesandlatestgates locally. I also rancargo clippy -p cordis-core --features loom-tests --test loom_inertia, because the workspace clippy gate skips this feature-gated test. It reported no warnings in the test. The lib has an existingfor_fiberdead-code warning that shows up only under this feature build.Loom (as the CI Loom job runs it:
cargo test --locked --release -p cordis-core --features loom-tests --test ...)loom_eraloom_inertiaRunning each new or changed LC-06 test on its own:
ready_answer_survives_a_complete_racing_restart_pass~5.1–5.6 s,ready_return_has_a_quiescent_linearization_point~2.4–3.0 s,ready_without_sequence_recheck_is_detected~0.4 s. This is well inside the 15-minute Loom job budget.🤖 Generated with Claude Code