Audit Report
Full results of the True Count game engine audit — 76 tests, 8 categories, all passing.
Executive Summary
| Field | Value |
|---|---|
| Engine | TrueCountEngine v1.0 |
| Bundle ID | com.wipalex.blacknight |
| Platform | iOS / Swift / TrueCountEngine (local Swift Package) |
| Audit Date | 2026-03-18 |
| RNG | GKMersenneTwisterRandomSource (Mersenne Twister, period 2^19937-1) |
| Shuffle | Fisher-Yates (Knuth shuffle) with seeded deterministic replay |
| Tests | 76 tests across 8 categories |
| Result | ALL PASS |
| Execution Time | ~167 seconds on Apple Silicon |
Category Verdicts
| # | Category | Tests | Verdict |
|---|---|---|---|
| 1 | RNG / Shuffle Evaluation | 10 | PASS |
| 2 | Deck Integrity | 6 | PASS |
| 3 | Rule Compliance | 20 | PASS |
| 4 | Payout Accuracy | 12 | PASS |
| 5 | Statistical Fairness | 12 | PASS |
| 6 | Basic Strategy Validation | 6 | PASS |
| 7 | Hi-Lo Counting Verification | 7 | PASS |
| 8 | Round Lifecycle Integrity | 6 | PASS |
For an explanation of what each category tests and why, see Game Engine Audit.
Category 1: RNG / Shuffle Evaluation
Tests the quality of the Fisher-Yates shuffle with Mersenne Twister PRNG across 100,000+ dealt cards per test.
| Test | Sample Size | Result |
|---|---|---|
| Rank distribution uniformity (chi-square, 2/6/8 decks) | 100K cards each | PASS |
| Suit distribution uniformity (chi-square, 2/6/8 decks) | 100K cards each | PASS |
| Serial correlation at lag 1 (2/6/8 decks) | 50K cards each | PASS (|r| < 0.02) |
| Runs test on first-card color across shuffles (2/6 decks) | 20K shuffles each | PASS |
| Inter-shuffle independence (first card rank) | 10K shuffles | PASS (|r| < 0.03) |
| First card position uniformity (chi-square) | 50K shuffles | PASS |
| Different seeds produce different shuffles | 1K seed pairs | PASS |
| Seed 0 produces valid shuffle | 1 shuffle | PASS |
| Seed UInt64.max produces valid shuffle | 1 shuffle | PASS |
Methodology: Chi-square goodness-of-fit with alpha = 0.001. Serial correlation uses Pearson's r. Runs test uses Wald-Wolfowitz with normal approximation.
Category 2: Deck Integrity
Verifies every shuffle produces a mathematically correct shoe. 10,000 shuffles per deck count.
| Test | Deck Counts Tested | Result |
|---|---|---|
| Shoe composition (correct card count) | 1, 2, 4, 6, 8 | PASS |
| No duplicates or missing cards | 1, 2, 4, 6, 8 | PASS |
standardDeck() returns 52 unique cards | N/A | PASS |
| Penetration / cut card position | All 5 tables | PASS |
shouldReshuffle fires at cutCardPosition | All 5 tables | PASS |
| Post-reshuffle reset restores full shoe | 1, 2, 4, 6, 8 | PASS |
Category 3: Rule Compliance
Deterministic tests verifying every game rule. 20 tests covering dealer logic, player actions, hand evaluation, settlement, and insurance.
| Subcategory | Tests | Result |
|---|---|---|
| Rank point values (ace=1, 2-9=face, 10/J/Q/K=10) | 1 | PASS |
| Hand totals (hard, soft, best, multi-ace, bust) | 1 | PASS |
| Blackjack detection (including split exclusion) | 1 | PASS |
| Pair detection with ten-value normalization | 1 | PASS |
| Dealer hit/stand (S17 and H17) | 2 | PASS |
| Soft 17 behavior | 1 | PASS |
| Peek for blackjack | 1 | PASS |
| Dealer blackjack detection | 1 | PASS |
| Skip dealer turn on player bust | 1 | PASS |
| Hit availability (all 5 tables) | 1 | PASS |
| Double restrictions (.any, .nineToEleven, .tenToEleven) | 3 | PASS |
| Double after split (DAS per table) | 1 | PASS |
| Split max hands = 2 | 1 | PASS |
| Split aces cannot re-split | 1 | PASS |
| Surrender rules | 1 | PASS |
| Settlement (BJ vs BJ, bust, totals) | 5 | PASS |
| Insurance availability by table | 1 | PASS |
| Insurance only on dealer ace | 1 | PASS |
Category 4: Payout Accuracy
Exhaustive payout verification with bet sizes: 10, 25, 50, 75, 100, 150, 500, 1000, 9999.
| Test | Bet Sizes | Result |
|---|---|---|
| Blackjack 3:2 payout | 9 | PASS |
| Blackjack 6:5 payout | 9 | PASS |
| Blackjack 1:1 payout | 9 | PASS |
| Win pays 2x bet | 9 | PASS |
| Push returns bet | 9 | PASS |
| Loss returns 0 | 9 | PASS |
| Surrender returns floor(bet/2) | 9 | PASS |
| Insurance cost = floor(originalBet/2) | 9 | PASS |
| Insurance return = 3x insurance bet | 9 | PASS |
| Double cost = current bet | 9 | PASS |
| BJ payout truncation on odd bets | 3 values | PASS |
| Bankroll conservation (all outcomes, all tables) | 5 tables | PASS |
Truncation verification: Odd bet amounts confirm integer truncation toward zero (e.g., 75 x 1.5 = 112.5 truncated to 112).
Category 5: Statistical Fairness
Monte Carlo simulations using basic strategy play. This is the ultimate integration test — if any engine component has a bug, the numbers will drift from expected values.
Dealer Bust Rates by Upcard
Tested across all 5 tables with 200,000 hands each. Reference values from Wizard of Odds (6-deck S17).
| Upcard | Expected Bust % | Tolerance | Result |
|---|---|---|---|
| Ace | 11.5% | +/- 3% | PASS (all tables) |
| 2 | 35.4% | +/- 3% | PASS (all tables) |
| 3 | 37.4% | +/- 3% | PASS (all tables) |
| 4 | 39.4% | +/- 3% | PASS (all tables) |
| 5 | 41.6% | +/- 3% | PASS (all tables) |
| 6 | 42.3% | +/- 3% | PASS (all tables) |
| 7 | 26.2% | +/- 3% | PASS (all tables) |
| 8 | 24.5% | +/- 3% | PASS (all tables) |
| 9 | 22.8% | +/- 3% | PASS (all tables) |
| 10-value | 21.2% | +/- 3% | PASS (all tables) |
Blackjack Natural Frequency
| Table | Decks | Expected | Tolerance | Result |
|---|---|---|---|---|
| Jean-Luc | 2 | 4.780% | p > 0.001 | PASS |
| Czarita | 4 | 4.757% | p > 0.001 | PASS |
| Jack | 6 | 4.749% | p > 0.001 | PASS |
| Lady Lux | 6 | 4.749% | p > 0.001 | PASS |
| Aunty | 8 | 4.745% | p > 0.001 | PASS |
House Edge Convergence
500,000 hands per table using perfect basic strategy (S17).
| Table | Decks | Expected Edge | Tolerance | Result |
|---|---|---|---|---|
| Jean-Luc | 2 | ~0.31% | +/- 0.40% | PASS |
| Czarita | 4 | ~0.39% | +/- 0.40% | PASS |
| Jack | 6 | ~0.57% | +/- 0.40% | PASS |
| Lady Lux | 6 | ~0.72% | +/- 0.40% | PASS |
| Aunty | 8 | ~2.02% | +/- 0.40% | PASS |
Reference values from Wizard of Odds house edge calculator.
Player Outcome Distribution
200,000 hands on Czarita (4-deck, S17, 3:2).
| Metric | Expected | Tolerance | Result |
|---|---|---|---|
| Player win rate | ~42.5% | +/- 2% | PASS |
| Player loss rate | ~49.0% | +/- 2% | PASS |
| Push rate | ~8.5% | +/- 2% | PASS |
Category 6: Basic Strategy Validation
Cell-by-cell verification of all three strategy charts against published Wizard of Odds multi-deck basic strategy.
| Chart | Cells Verified | Result |
|---|---|---|
| Hard totals (5-8 through 17+) | 100 | PASS |
| Soft totals (A,2 through A,9) | 80 | PASS |
| Pairs (2,2 through A,A) | 100 | PASS |
| H17 overrides (exactly 3 differences) | 3 | PASS |
recommendationIgnoringPairs fallback | Verified | PASS |
| Surrender never returned by engine | All hands x all upcards | PASS |
Total: 280 strategy cells verified against published reference.
Category 7: Hi-Lo Counting Verification
| Test | Result |
|---|---|
| Point values: 2-6 = +1, 7-9 = 0, 10-A = -1 | PASS |
| Running count tracks correctly through known sequence | PASS |
| Full shoe deal balances to RC=0 (1/2/4/6/8 decks) | PASS |
| True count = RC / decks remaining | PASS |
| Decks remaining clamps to minimum 0.5 | PASS |
| Player edge = -baseHouseEdge + TC x 0.005 | PASS |
| Reset zeroes running count | PASS |
Category 8: Round Lifecycle Integrity
Full-round integration tests using RoundEngine. 10,000 rounds per table.
| Test | Sample | Result |
|---|---|---|
Every round reaches roundComplete | 10K rounds x 5 tables | PASS |
| Bankroll conservation (wagered - returned = delta) | 10K rounds x 5 tables | PASS |
| Shoe reshuffles before exhaustion (1-deck stress test) | 5K rounds | PASS |
| Split aces: 1 card each, no hit, no BJ, correct payout | Seeded scenario | PASS |
| All phase transitions are valid | 10K rounds | PASS |
| Insurance + dealer BJ settles correctly | Seeded scenario | PASS |
Statistical Methodology
| Parameter | Value |
|---|---|
| Significance level | alpha = 0.001 (99.9% confidence) |
| Verdict tiers | PASS (p > 0.01), WARN (0.001 < p < 0.01), FAIL (p < 0.001) |
| Chi-square approximation | Wilson-Hilferty normal approximation |
| Normal CDF | C standard library erfc (exact) |
| Reproducibility | All tests use fixed seeds — re-running produces identical results |
Reproducibility
Every test in this audit uses deterministic seeded PRNG. To reproduce these exact results:
cd TrueCountEngine && swift test --filter TrueCountEngineAuditThe full test source code is open and available in the repository under TrueCountEngine/Tests/TrueCountEngineAudit/.
Caveats
- This is a self-audit, not a third-party certification. We are not accredited by GLI, BMM, or any gaming laboratory.
- True Count is an entertainment app — no real money, no gambling. This audit exists for transparency and quality assurance.
- Reference house edge values are approximate (sourced from published calculators) and tolerance bands account for finite penetration effects.
- Statistical tests are inherently probabilistic. A passing result means no statistically significant deviation was detected, not that deviation is impossible.
How is this guide?