Phase 1 / Etch / Time subsystem and timers#42
Merged
Conversation
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.
Brief: briefs/M1.0.13-time-and-timers.md
Closing notes
every/after_unscaledgraduated (quantizestays reserved, fail-loud re-pointed at a later Sequencer-adjacent milestone);TimerKind/TimerStmtAST slab;timer_stmtparses (unbound at statement head +let-bound inparseLetStmt, the spawn precedent;mut/annotation rejected);TimerHandlebuiltin type (cancel()only, not awaitable, non-POD field-rejected), timer arg typed as a fullDurationexpression, timer body enforced as a synchronous context (E0901);pub const builtin_resourcesdescriptor table intypes.zig(GameTime/UnscaledTime/RealTime,fixed_dt = 1/60) consumed by the checker (ambientget(GameTime).dt, nowhengate) and byinterp.zigPass A (TagSet injection point, idempotent hot-reload, accumulators re-seeded from surviving totals);stepOncetime population (dt/total/frame/fixed_frame; unscaled/real unaffected bytime_scale/paused);await wait/await wait_unscaledre-plumbed onto the game/unscaled clocks (literal-only restriction kept for both);async_tickdemoted to the frame counter; runtime timer registry (monotone pointer-stable + husk, scope snapshot at scheduling, firing at the tick head in registration order,everyre-armed at a fixed period,cancel()idempotent with a mid-fire latch,Value.timer_handlebound in the parent scope after the snapshot).time_scale = 1: proven by the untouched M1.0.11/12 tick-precise tests (the 60-tick wait test is the explicit witness); realized by the tick-unit accumulator representation — see Recorded deviations (accepted at the E5 review; §9.12 reconciled KB-side by Guy).src/etch/):value.zig(timer_handle— the E6 deliverableValue.timer_handle;duration— runtime Duration seconds soafter(d)takes a variable;eqlarms) and the.duration_litarm inevalExpr.wait_unscaledhalf retired (it graduates here; the remaining boundary isentity_event, M1.0.14); two stale M1.0.12 token-test assertions on the reserved timer family removed at E1; test-narration comments "wake at async_tick N" renamed to "wake at game clock N" (same values atscale = 1); one stale future-tense M1.0.13 comment rewritten as the byte-identity witness note.engine-gameplay-systems.md), the FROZEN brief's own citation convention. Drift audit clean after the comment patches above; no orphaned references to the timer fail-loud, the reserved timer family, or thewait_unscaledpartition remain insrc//tools//tests/.quantize(Sequencer-adjacent milestone),time.*stdlib sugar (+ the deferredetch-stdlib.md §20reconciliation),dtrule-parameter injection, per-entityTimeDilation/selective pause/WorldClock, liftingwait's literal-only restriction, Phase-2 bytecode lowering.debugandReleaseSafeat every gate and at close;zig build,zig fmt --check,zig build lintgreen; no benchmarks required. CLAUDE.md §3.4 updated on the branch (docs(claude-md): update for M1.0.13).Validation checklist (Étape 4)
quantizereserved;wait/wait_unscaledstay literal-only; notime.*sugar, nodtparam, no scheduler features)debugandReleaseSafeafter(d)at the exact tick,time_scale = 0.5stretch, pause freeze vsafter_unscaled, same-tick emit visibility)zig build,zig build test(debug + ReleaseSafe),zig fmt --check,zig build lintgreendocs(claude-md): update for M1.0.13)async_tickwake comments, stale future-tense M1.0.13 note) or noted in Closing notesStatus: CLOSED,Closed: 2026-07-04docs(brief): close M1.0.13🤖 Generated with Claude Code