Skip to content

Phase 1 / Etch / Time subsystem and timers#42

Merged
guysenpai merged 18 commits into
mainfrom
phase-1/etch/time-and-timers
Jul 4, 2026
Merged

Phase 1 / Etch / Time subsystem and timers#42
guysenpai merged 18 commits into
mainfrom
phase-1/etch/time-and-timers

Conversation

@guysenpai

Copy link
Copy Markdown
Contributor

Brief: briefs/M1.0.13-time-and-timers.md

Closing notes

  • Delivered (E1→E6, each gate GO'd on the pushed diff). every/after_unscaled graduated (quantize stays reserved, fail-loud re-pointed at a later Sequencer-adjacent milestone); TimerKind/TimerStmt AST slab; timer_stmt parses (unbound at statement head + let-bound in parseLetStmt, the spawn precedent; mut/annotation rejected); TimerHandle builtin type (cancel() only, not awaitable, non-POD field-rejected), timer arg typed as a full Duration expression, timer body enforced as a synchronous context (E0901); pub const builtin_resources descriptor table in types.zig (GameTime/UnscaledTime/RealTime, fixed_dt = 1/60) consumed by the checker (ambient get(GameTime).dt, no when gate) and by interp.zig Pass A (TagSet injection point, idempotent hot-reload, accumulators re-seeded from surviving totals); stepOnce time population (dt/total/frame/fixed_frame; unscaled/real unaffected by time_scale/paused); await wait/await wait_unscaled re-plumbed onto the game/unscaled clocks (literal-only restriction kept for both); async_tick demoted to the frame counter; runtime timer registry (monotone pointer-stable + husk, scope snapshot at scheduling, firing at the tick head in registration order, every re-armed at a fixed period, cancel() idempotent with a mid-fire latch, Value.timer_handle bound in the parent scope after the snapshot).
  • Byte-identity at 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).
  • Files touched beyond the per-file list (both justified in the Execution log, within src/etch/): value.zig (timer_handle — the E6 deliverable Value.timer_handle; duration — runtime Duration seconds so after(d) takes a variable; eql arms) and the .duration_lit arm in evalExpr.
  • Fix-as-you-go: the M1.0.11 partition test's wait_unscaled half retired (it graduates here; the remaining boundary is entity_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 at scale = 1); one stale future-tense M1.0.13 comment rewritten as the byte-identity witness note.
  • §3.6.1 audits: language audit clean — the only French hits on the branch diff are verbatim quotes of the spec section title "Les trois temps" (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 the wait_unscaled partition remain in src//tools//tests/.
  • Residuals (scope boundaries, not debt): quantize (Sequencer-adjacent milestone), time.* stdlib sugar (+ the deferred etch-stdlib.md §20 reconciliation), dt rule-parameter injection, per-entity TimeDilation/selective pause/WorldClock, lifting wait's literal-only restriction, Phase-2 bytecode lowering.
  • Validation: full suite green in debug and ReleaseSafe at every gate and at close; zig build, zig fmt --check, zig build lint green; no benchmarks required. CLAUDE.md §3.4 updated on the branch (docs(claude-md): update for M1.0.13).

Validation checklist (Étape 4)

  • All Scope deliverables present (E1→E6, gate-by-gate GO on the pushed diffs)
  • No drift into Out of scope (quantize reserved; wait/wait_unscaled stay literal-only; no time.* sugar, no dt param, no scheduler features)
  • All Acceptance-criteria tests green in debug and ReleaseSafe
  • Benchmarks: none required
  • Observable behavior demonstrable (E6 inline tests: after(d) at the exact tick, time_scale = 0.5 stretch, pause freeze vs after_unscaled, same-tick emit visibility)
  • zig build, zig build test (debug + ReleaseSafe), zig fmt --check, zig build lint green
  • CLAUDE.md §3.4 updated and committed on the branch (docs(claude-md): update for M1.0.13)
  • Language audit (§3.6.1) passed — branch diff + brief free of French prose (verbatim "Les trois temps" spec-title quotes only)
  • Local drift audit (§3.6.1) passed — orphans patched (async_tick wake comments, stale future-tense M1.0.13 note) or noted in Closing notes
  • Closing notes filled
  • Brief Status: CLOSED, Closed: 2026-07-04
  • Final commit docs(brief): close M1.0.13

🤖 Generated with Claude Code

@guysenpai guysenpai merged commit 07ef06b into main Jul 4, 2026
10 checks passed
@guysenpai guysenpai deleted the phase-1/etch/time-and-timers branch July 4, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant