Skip to content

perf: latency target enforcement and first optimizations (P-6) - #159

Merged
spuentesp merged 1 commit into
masterfrom
perf/latency-optimization
Nov 29, 2026
Merged

spuentesp merged 1 commit into
masterfrom
perf/latency-optimization

Conversation

@spuentesp

Copy link
Copy Markdown
Owner

Work in progress from 2026-11-19, rebased onto master after #158. First pass of docs/architecture/LATENCY_OPTIMIZATION_PLAN.md (P-6 scene turn latency).

What's in it

  • SceneLoop.run emits SCENE_TURN_MS per turn and warns TURN_OVER_TARGET past MONITOR_TURN_LATENCY_TARGET_S (default 40s, p95 target).
  • The wrap-up router runs its independent steps concurrently (asyncio.gather).
  • /gm/lookup/improvise role override (MONITOR_GM_IMPROVISE_ROLE) and GM_LOOKUP_LATENCY logging past the 30s lookup budget.
  • Opt-in narrator skip for simple no-roll Q&A turns (MONITOR_NARRATOR_SKIP_SIMPLE_TURNS, off by default until measured in a playtest).
  • scripts/measure_turn_latency.py for live p50/p95 measurement.

Not started (from the plan)

  • Classifier-based route matching.
  • Folding the narrator's compatibility check into the refine call.

Verification

  • ruff, layer check and strict mypy clean.
  • Full suite in a clean worktree: 10,850 passed, 236 skipped, 0 failed.

🤖 Generated with Claude Code

…gress from 2026-11-19)

- SceneLoop.run emits SCENE_TURN_MS per turn and warns TURN_OVER_TARGET past
  MONITOR_TURN_LATENCY_TARGET_S (default 40s, p95 target)
- wrap-up router runs its independent steps concurrently (asyncio.gather)
- /gm/lookup/improvise role override (MONITOR_GM_IMPROVISE_ROLE) and
  GM_LOOKUP_LATENCY logging past the 30s lookup budget
- opt-in narrator skip for simple no-roll Q&A turns
  (MONITOR_NARRATOR_SKIP_SIMPLE_TURNS, off by default)
- scripts/measure_turn_latency.py for live p50/p95 measurement
- docs/architecture/LATENCY_OPTIMIZATION_PLAN.md consolidates the plan

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@spuentesp
spuentesp merged commit e6f320e into master Nov 29, 2026
5 checks passed
@spuentesp
spuentesp deleted the perf/latency-optimization branch November 29, 2026 17:41
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