~/bend-docscommunity

change_tick.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.3/change_tick.bend as Change_tick

1 import
import Base

Types

type Tick source · line 6 · raw

Data

Logical change timestamp. low wraps modulo 2^32; epoch preserves the history needed to age dormant components/readers across low wraps within runtime limits. Raw constructors are trusted: execution must not supply future stamps/cursors.

Definitions

def max_change_age source · line 11 · raw

U32

Pinned Bevy ad678262 change_detection/mod.rs MAX_CHANGE_AGE. Exact epochs replace periodic storage sweeps, not this observable age bound.

def zero source · line 15 · raw

Tick

Initial administrative timestamp. Zero is valid, not component absence or a fabricated first-run cursor; first-run reader policy is supplied separately.

def incremented source · line 17 · raw

@wrapped:Bool -> @epoch:Nat -> @low:U32 -> Tick

def next source · line 23 · raw

@tick:Tick -> Tick

Advance one logical execution boundary, carrying the epoch on low-word wrap.

def low source · line 28 · raw

@tick:Tick -> U32

Diagnostic low word only; never use this projection as an independent cursor.

def total source · line 34 · raw

@tick:Tick -> Nat

Monotone logical ordinal for existing Nat-based observation/runtime domains. Backend Nat representation limits still apply to consumers of this projection.

def ordered_epochs source · line 38 · raw

@equal:Bool -> @earlier:Bool -> @stamp:U32 -> @this:U32 -> Bool

def not_future source · line 45 · raw

@stamp:Tick -> @this:Tick -> Bool

Explicit validity of a timestamp relative to this execution. Future values are not made recent by saturating Nat subtraction.

def crossing_age source · line 49 · raw

@lowWrapped:Bool -> @stamp:U32 -> @this:U32 -> U32

def distance source · line 54 · raw

@same:Bool -> @adjacent:Bool -> @+stamp:U32 -> @+this:U32 -> U32

def valid_age source · line 60 · raw

@valid:Bool -> @stamp:Tick -> @this:Tick -> U32

def age source · line 68 · raw

@+stamp:Tick -> @+this:Tick -> U32

True elapsed age capped at Bevy's MAX_CHANGE_AGE, including multiple wraps. Invalid future stamps return MAX; use not_future when distinguishing invalid inputs from legitimately old data. No global storage maintenance is required.

def valid_newer source · line 71 · raw

@valid:Bool -> @stamp:Tick -> @last:Tick -> @+this:Tick -> Bool

def newer source · line 79 · raw

@+stamp:Tick -> @+last:Tick -> @+this:Tick -> Bool

Compare component age with independent reader age. Equality and two maximally old timestamps are not new. A future stamp OR reader cursor rejects as False; callers separately establish component presence and first-run reader policy.

def show source · line 83 · raw

@tick:Tick -> String

Detached full-timestamp diagnostic; the epoch is never discarded.

def cursor_show source · line 87 · raw

@cursor:Maybe<&2, Tick> -> String

Distinguish an uninitialized lifecycle cursor from the legitimate zero tick.