True Count
Game Engine Audit

Audit Report

Full results of the True Count game engine audit — 76 tests, 8 categories, all passing.

Executive Summary

FieldValue
EngineTrueCountEngine v1.0
Bundle IDcom.wipalex.blacknight
PlatformiOS / Swift / TrueCountEngine (local Swift Package)
Audit Date2026-03-18
RNGGKMersenneTwisterRandomSource (Mersenne Twister, period 2^19937-1)
ShuffleFisher-Yates (Knuth shuffle) with seeded deterministic replay
Tests76 tests across 8 categories
ResultALL PASS
Execution Time~167 seconds on Apple Silicon

Category Verdicts

#CategoryTestsVerdict
1RNG / Shuffle Evaluation10PASS
2Deck Integrity6PASS
3Rule Compliance20PASS
4Payout Accuracy12PASS
5Statistical Fairness12PASS
6Basic Strategy Validation6PASS
7Hi-Lo Counting Verification7PASS
8Round Lifecycle Integrity6PASS

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.

TestSample SizeResult
Rank distribution uniformity (chi-square, 2/6/8 decks)100K cards eachPASS
Suit distribution uniformity (chi-square, 2/6/8 decks)100K cards eachPASS
Serial correlation at lag 1 (2/6/8 decks)50K cards eachPASS (|r| < 0.02)
Runs test on first-card color across shuffles (2/6 decks)20K shuffles eachPASS
Inter-shuffle independence (first card rank)10K shufflesPASS (|r| < 0.03)
First card position uniformity (chi-square)50K shufflesPASS
Different seeds produce different shuffles1K seed pairsPASS
Seed 0 produces valid shuffle1 shufflePASS
Seed UInt64.max produces valid shuffle1 shufflePASS

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.

TestDeck Counts TestedResult
Shoe composition (correct card count)1, 2, 4, 6, 8PASS
No duplicates or missing cards1, 2, 4, 6, 8PASS
standardDeck() returns 52 unique cardsN/APASS
Penetration / cut card positionAll 5 tablesPASS
shouldReshuffle fires at cutCardPositionAll 5 tablesPASS
Post-reshuffle reset restores full shoe1, 2, 4, 6, 8PASS


Category 3: Rule Compliance

Deterministic tests verifying every game rule. 20 tests covering dealer logic, player actions, hand evaluation, settlement, and insurance.

SubcategoryTestsResult
Rank point values (ace=1, 2-9=face, 10/J/Q/K=10)1PASS
Hand totals (hard, soft, best, multi-ace, bust)1PASS
Blackjack detection (including split exclusion)1PASS
Pair detection with ten-value normalization1PASS
Dealer hit/stand (S17 and H17)2PASS
Soft 17 behavior1PASS
Peek for blackjack1PASS
Dealer blackjack detection1PASS
Skip dealer turn on player bust1PASS
Hit availability (all 5 tables)1PASS
Double restrictions (.any, .nineToEleven, .tenToEleven)3PASS
Double after split (DAS per table)1PASS
Split max hands = 21PASS
Split aces cannot re-split1PASS
Surrender rules1PASS
Settlement (BJ vs BJ, bust, totals)5PASS
Insurance availability by table1PASS
Insurance only on dealer ace1PASS


Category 4: Payout Accuracy

Exhaustive payout verification with bet sizes: 10, 25, 50, 75, 100, 150, 500, 1000, 9999.

TestBet SizesResult
Blackjack 3:2 payout9PASS
Blackjack 6:5 payout9PASS
Blackjack 1:1 payout9PASS
Win pays 2x bet9PASS
Push returns bet9PASS
Loss returns 09PASS
Surrender returns floor(bet/2)9PASS
Insurance cost = floor(originalBet/2)9PASS
Insurance return = 3x insurance bet9PASS
Double cost = current bet9PASS
BJ payout truncation on odd bets3 valuesPASS
Bankroll conservation (all outcomes, all tables)5 tablesPASS

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).

UpcardExpected Bust %ToleranceResult
Ace11.5%+/- 3%PASS (all tables)
235.4%+/- 3%PASS (all tables)
337.4%+/- 3%PASS (all tables)
439.4%+/- 3%PASS (all tables)
541.6%+/- 3%PASS (all tables)
642.3%+/- 3%PASS (all tables)
726.2%+/- 3%PASS (all tables)
824.5%+/- 3%PASS (all tables)
922.8%+/- 3%PASS (all tables)
10-value21.2%+/- 3%PASS (all tables)

Blackjack Natural Frequency

TableDecksExpectedToleranceResult
Jean-Luc24.780%p > 0.001PASS
Czarita44.757%p > 0.001PASS
Jack64.749%p > 0.001PASS
Lady Lux64.749%p > 0.001PASS
Aunty84.745%p > 0.001PASS

House Edge Convergence

500,000 hands per table using perfect basic strategy (S17).

TableDecksExpected EdgeToleranceResult
Jean-Luc2~0.31%+/- 0.40%PASS
Czarita4~0.39%+/- 0.40%PASS
Jack6~0.57%+/- 0.40%PASS
Lady Lux6~0.72%+/- 0.40%PASS
Aunty8~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).

MetricExpectedToleranceResult
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.

ChartCells VerifiedResult
Hard totals (5-8 through 17+)100PASS
Soft totals (A,2 through A,9)80PASS
Pairs (2,2 through A,A)100PASS
H17 overrides (exactly 3 differences)3PASS
recommendationIgnoringPairs fallbackVerifiedPASS
Surrender never returned by engineAll hands x all upcardsPASS

Total: 280 strategy cells verified against published reference.


Category 7: Hi-Lo Counting Verification

TestResult
Point values: 2-6 = +1, 7-9 = 0, 10-A = -1PASS
Running count tracks correctly through known sequencePASS
Full shoe deal balances to RC=0 (1/2/4/6/8 decks)PASS
True count = RC / decks remainingPASS
Decks remaining clamps to minimum 0.5PASS
Player edge = -baseHouseEdge + TC x 0.005PASS
Reset zeroes running countPASS


Category 8: Round Lifecycle Integrity

Full-round integration tests using RoundEngine. 10,000 rounds per table.

TestSampleResult
Every round reaches roundComplete10K rounds x 5 tablesPASS
Bankroll conservation (wagered - returned = delta)10K rounds x 5 tablesPASS
Shoe reshuffles before exhaustion (1-deck stress test)5K roundsPASS
Split aces: 1 card each, no hit, no BJ, correct payoutSeeded scenarioPASS
All phase transitions are valid10K roundsPASS
Insurance + dealer BJ settles correctlySeeded scenarioPASS


Statistical Methodology

ParameterValue
Significance levelalpha = 0.001 (99.9% confidence)
Verdict tiersPASS (p > 0.01), WARN (0.001 < p < 0.01), FAIL (p < 0.001)
Chi-square approximationWilson-Hilferty normal approximation
Normal CDFC standard library erfc (exact)
ReproducibilityAll 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 TrueCountEngineAudit

The 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?

On this page