aetherlight: the clean-log contract of a view read holds in release builds
derive_motion asserts, not debug_asserts, that the six partitions the views join have no open log, so a stale view cannot be read silently in a shipped build; the refusal test runs in every profile. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ba6c2dcd05
commit
e76ba61ee6
2 changed files with 3 additions and 3 deletions
|
|
@ -116,10 +116,11 @@ mod step {
|
|||
/// What is due, and which dependencies fail, is read from `Views` (the one owner
|
||||
/// of both questions: a live subject's due commitments and a live subject's
|
||||
/// unavailable dependencies), so a tick reads the work it does and not the
|
||||
/// world. A view is true only with clean logs, so both callers (`reduce`, and
|
||||
/// world. A view is true only with clean logs, so it is read behind a check
|
||||
/// that holds in every build (six flag tests), and both callers (`reduce`, and
|
||||
/// `apply_effect`'s `TimeAdvanced` arm before its first write) call it clean.
|
||||
pub(super) fn derive_motion(state: &WorldState, to: FictionalMinutes) -> Motion {
|
||||
debug_assert!(views::readable(state), "the views are read with an open log");
|
||||
assert!(views::readable(state), "the views are read with an open log");
|
||||
motion_of(state, to, &state.views.due_by(to), state.views.failing().copied())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1511,7 +1511,6 @@ fn a_corrupted_view_is_detected() {
|
|||
|
||||
/// A view is read only with clean logs: reading one while a partition it joins
|
||||
/// has an open write is refused, not answered from a stale fold.
|
||||
#[cfg(debug_assertions)]
|
||||
#[test]
|
||||
#[should_panic(expected = "open log")]
|
||||
fn a_view_read_with_an_open_log_is_refused() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue