refactor(engine): first ambiguity burn-down batch — 302 → 198 pairs #146

Merged
funman300 merged 1 commits from refactor/ambiguity-burndown into master 2026-07-07 03:37:53 +00:00
Owner

First #143 burn-down batch (−104 pairs, −34%):

  1. Game-state ordering spine — pre-mutation writers (tick_elapsed_time → sync_settings_to_game → handle_restore_prompt) chained before GameMutation; all remaining unordered readers ordered after it. Readers now deterministically see the current frame's moves.
  2. NewGameRequestWriters set — all in-cluster writers of the new-game trigger registered in a self-ambiguous set (append order is meaningless; consumers drain the queue).

Baseline ratchets 302 → 198. Remaining backlog is dominated by the Sprite(72)/Transform(48) visual-domain cluster — needs per-domain set architecture, next batch.

Gates: ratchet test green at new baseline, workspace clippy --all-targets -D warnings clean, full test suite green.

Refs #143

🤖 Generated with Claude Code

First #143 burn-down batch (−104 pairs, −34%): 1. **Game-state ordering spine** — pre-mutation writers (`tick_elapsed_time → sync_settings_to_game → handle_restore_prompt`) chained before `GameMutation`; all remaining unordered readers ordered after it. Readers now deterministically see the current frame's moves. 2. **`NewGameRequestWriters` set** — all in-cluster writers of the new-game trigger registered in a self-ambiguous set (append order is meaningless; consumers drain the queue). Baseline ratchets **302 → 198**. Remaining backlog is dominated by the Sprite(72)/Transform(48) visual-domain cluster — needs per-domain set architecture, next batch. Gates: ratchet test green at new baseline, workspace clippy `--all-targets -D warnings` clean, full test suite green. Refs #143 🤖 Generated with [Claude Code](https://claude.com/claude-code)
funman300 added 1 commit 2026-07-07 03:37:52 +00:00
Two structural fixes from the #143 backlog:

- Game-state ordering spine: the three pre-mutation GameStateResource
  writers (tick_elapsed_time, sync_settings_to_game,
  handle_restore_prompt) are now a deterministic chain before
  GameMutation, and the remaining unordered readers
  (update_selection_hud, handle_hint_button, tick_hint_highlight,
  handle_right_click, snap_cards_on_window_resize,
  sync_pile_marker_visibility, auto_save_game_state) are ordered after
  it. Readers now see the current frame's moves deterministically
  instead of racing the mutators.

- NewGameRequestWriters set: every in-cluster writer of
  NewGameRequestEvent (buttons, modals, mode picker, seed poller,
  restore prompt) is registered in a shared set marked ambiguous with
  itself — writer-vs-writer append order is meaningless since consumers
  drain the whole queue. Out-of-cluster writers (home, challenge,
  time-attack, win-summary, play-by-seed, difficulty, stats plugins)
  can join the set when the test cluster grows.

AMBIGUITY_BASELINE ratchets 302 → 198. Remaining backlog is dominated
by the Sprite (72) / Transform (48) visual-domain cluster, which needs
per-domain set architecture — next batch.

Refs #143

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
funman300 merged commit 710555bd7e into master 2026-07-07 03:37:53 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#146