Skip to main content

Module stage

Module stage 

Source
Expand description

StepStage — transactional COW staging for one step() (9 buckets).

Every commit-conditional write the kernel performs during a step is buffered here; on commit, Instance::apply_stage drains in canonical canonical order; on rollback, the stage is dropped without effect.

Buckets (9):

  1. state_ops — entity/component mutations
  2. events — KernelEvent emissions (kernel-level drain)
  3. schedule_deltas — scheduler add/cancel
  4. pending_signals — outbound IPC (kernel routes post-commit)
  5. id_counters — monotonic ID counter advances
  6. ledger_delta — ResourceLedger updates
  7. wall_remainder_delta — sub-tick time accumulator advance
  8. local_tick_delta — logical tick advance
  9. observer_eviction_pending — observers slated for eviction

In-flight signal refcounts are NOT staged: the only refcount writers are the cross-instance signal router (delivery-side increment — it spans instances and so cannot route through a single instance’s stage) and force_unload (drain), both mutating Instance::inflight_refs directly.