47 lines
2.6 KiB
Markdown
47 lines
2.6 KiB
Markdown
# Local environmental scheduling
|
|
|
|
Authority: ADR-0057. Adapter version 1 supports process rules/envelopes 1 and 2.
|
|
The adapter has no persisted state. Tick duration is read from immutable process
|
|
configuration; all rate residuals and committed tick live in the process envelope.
|
|
|
|
```mermaid
|
|
flowchart LR
|
|
H[Host supplies world, begin, end, quantum and inputs] --> A[Admit current boundary and at most 64 ticks]
|
|
A --> T[Execute one complete process tick]
|
|
T -->|success: record receipt| N{More inputs?}
|
|
N -->|yes| T
|
|
N -->|no| R[Return committed prefix and final tick]
|
|
T -->|failure: no changes for this tick| R
|
|
A -->|invalid| E[Reject with no progress]
|
|
```
|
|
|
|
`schedule_environment(community, interval)` returns expected<EnvironmentalIntervalResult,
|
|
EnvironmentalIntervalError>. `begin` is the completed read revision, `end` the
|
|
requested completed revision. `inputs[i]` applies at begin+i+1. Require matching
|
|
world/frame, immutable tick_microseconds, process tick and field command revision.
|
|
No duration multiplication is used, so intervals cannot overflow microseconds.
|
|
Subtract end-begin only after end>=begin; reject count>64 before accessing inputs.
|
|
|
|
Admission errors are identity, quantum, stale, range, backlog or input_count.
|
|
Result contains committed count, last_tick, fixed reports array (only committed
|
|
entries are meaningful), and optional failure {tick,cause}. Failure may exist with
|
|
zero committed ticks. A successful expected alone does not mean the full interval
|
|
completed. On failure, snapshot the owner normally; resume at last_tick with the
|
|
suffix, correcting the rejected input if appropriate. Failed ticks never enter
|
|
retry history. Reusing the old begin is stale once any prefix committed.
|
|
|
|
Empty matching intervals leave canonical bytes unchanged, including at u64 max.
|
|
Not calling the adapter also pauses biological time. No elapsed-time parameter or
|
|
automatic catch-up exists. Hosts with more than 64 inputs must issue bounded
|
|
prefixes; the adapter never silently drops pending work. The 64-tick limit bounds
|
|
one call's work, not accumulated world age or total host backlog storage.
|
|
|
|
Batch partitioning is observationally equivalent for the same ordered inputs:
|
|
compare flattened receipts and final canonical snapshots. This includes phase
|
|
ordering, resource exhaustion, rational rate residuals and terminal decay. It
|
|
does not justify integrating growth/feeding/decay once with a larger timestep.
|
|
The exact same quantum is required after restore; changing it needs a migration.
|
|
|
|
No world/account/region service is added. This fixture contains no player sessions;
|
|
pause/resume is not an implementation of the unresolved player logout policy.
|