Skip to content

Complete Blackjack simulation milestone - #13203

Open
AlexRasevych wants to merge 10 commits into
mainfrom
blackjack-milestone
Open

AlexRasevych wants to merge 10 commits into
mainfrom
blackjack-milestone

Conversation

@AlexRasevych

Copy link
Copy Markdown
Collaborator

Summary

  • Added the Blackjack simulation layer with explicit RoundPlay and
    BlackjackSimulation refusal outcomes.
  • Added deterministic simulation witnesses for short-shoe refusal handling,
    completed plans, summary reconciliation, and paired seeded strategies.
  • Added the wet entropy-to-shuffle boundary witness.
  • Added the Blackjack README using the four-view loop.

Validation

  • gunbc compile for simulation.dag: 0 blocking errors.
  • Four deterministic simulation witnesses pass.
  • Mutation checks confirmed the short-shoe refusal-index and reconciliation
    witnesses fail when their guarded behavior is deliberately broken.
  • Wet witness currently reaches Urandom.ReadBytes but the local runner reports
    unknown service operation: Urandom.ReadBytes.
  • Rust emission completes, but generated-crate cargo check currently fails in
    generated std_bytes.rs / std_encoding.rs; generated Rust was not edited.

AlexRasevych and others added 10 commits September 23, 2026 03:28
* blackjack brief: simulate stops the line on an engine refusal

play_round was specified as -> SimulatedRound, a type that can only hold a
completed round, while every engine call it drives returns RoundStep and may
be RoundRefused. A learner had to fabricate a round or drop it silently.

Inside a simulation every RoundRefusal cause is a driver defect (fresh
52-card shoe per round, the driver orders the calls), so a refusal is not a
statistic: play_round returns RoundPlay = RoundPlayed | RoundPlayRefused, and
simulate returns BlackjackSimulation = SimulationCompleted { rounds } |
SimulationRefused { round_index, seed, cause }, stopping at the first
refusal with what replays it. The summary loses the requested/completed
pair (a run completes every round or refuses) and summarizes only a
completed run. play_round_from_shoe is split out so the refusal route can
execute in a test (short shoe -> ShoeExhausted). Acceptance bar and the
simulation.dag marker updated; projection regenerated from expected_plan_md
through gunbc.plan plan_generation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019kAKvQXHWK1YxuJaKnhQg2

* blackjack brief: run the SimulationRefused arm through simulate itself

The short-shoe test drove play_round_from_shoe directly, so the conversion
from RoundPlayRefused to SimulationRefused inside simulate never executed:
from a plan every shoe is a full deck and no round can refuse, so a
simulate that fabricated a round, carried on, or attached the wrong
index/seed passed every specified test.

simulate is now simulate_shoes(seeded_shoes(plan), rules, strategy), with
SeededShoe { seed, shoe } supplied as values. The prescribed test hands
simulate_shoes three shoes whose second is short and asserts the whole
SimulationRefused { round_index: 1, seed, cause: ShoeExhausted }; the
real-route claim is that simulate(plan) completes exactly plan.rounds
rounds. Projection regenerated through gunbc.plan plan_generation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019kAKvQXHWK1YxuJaKnhQg2

---------

Co-authored-by: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants