Magic Vault 5×3 — Math Specification

draft-v0.1 — DEV ONLY. NOT FOR PRODUCTION. NOT FOR CERTIFICATION. Not frozen. Internal tests and simulations are not external certification.

1. Identity and provenance

FieldValue
Game IDmagic-vault-5x3
Go packagemagic_vault_5x3
Math versiondraft-v0.1
Lifecycle statedraft — mutable
Canonical configlibs/mathengine/games/magic_vault_5x3/magic-vault-5x3.yaml
Config SHA-256a42ae35875e200728a8bc9178b18c1ca19d4af1fdb92d96e3d775cb6556e7873
Backend commiteb4cd2dfb4b176ebeab18a5c74212124b76fc7b9
RNG algorithm/versionsha256-trunc64-be/go1-alfg#1
Mechanichold_and_win/v1, reused unchanged
Engine capabilityhold_and_win = SupportFull; whole game not enumerable

The canonical config is not duplicated in this workspace. The SHA-256 above is computed from the exact bytes the binary embeds (magic_vault_5x3.RawYAML()), not from a separately read file.

Relationship to hold_and_win_reference

hold_and_win_reference is a mechanic reference host, not a game. Magic Vault reuses its mechanic implementation, RNG draw order, replay contract and economic parameters, and inherits none of its base reels, base RTP, trigger frequency or whole-game RTP. The reference pack's final-v1.0 evidence is not evidence for this game.

2. Bet and payout units

QuantityUnit
Paytable entries (§5)line-bet multipliers; the engine divides each line win by the number of paylines (10)
Hold & Win coin values, Mini/Minor/Major, Grandtotal-bet multipliers, undivided
MaxWinMultiplier (round cap and mechanic cap)total-bet multiplier
RTP, hit frequency, σfractions / multiples of total bet per round

Mixing the two units is how a spec comes to quote an RTP ten times the real one. Pinned by TestLinePayoutsAreLineBetMultipliers.

3. Locked rules (design-locked for Draft v0.1)

  • Grid 5 reels × 3 rows; feature grid 5 columns × 3 rows, 15 cells.
  • Canonical cell index column * 3 + row (column * Rows + row in the engine).
  • 10 fixed paylines, left to right, beginning on reel 1, geometry as in the GDD §5.
  • Symbol set WILD, COIN, H1–H4, L1–L4. No BONUS symbol exists.
  • WILD substitutes for H1–H4 and L1–L4, never for COIN.
  • COIN has no line payout at any count.
  • Trigger: 6 or more visible COIN; triggering cells become the initial locked cells in place.
  • hold_and_win/v1 economics: 3 initial respins, 43,000 PPM landing chance, regular coin values/weights 1:30, 2:25, 3:18, 5:15, 10:10, 20:2, prize weights regular:1000, mini:20@10×, minor:5@25×, major:1@100×, Grand 500× on a full grid replacing the sum, mechanic cap 500×.
  • Whole-round cap 500×, applied once.

Pinned by TestApprovedPaylines, TestSymbolSet, TestCoinHasNoLinePayout, TestLockedHoldAndWinParameters.

4. Mathematical model

Reel model

The strips are weighted entries, not stops. One weighted draw per reel picks an entry index i; the visible column is entries i, i+1, i+2 of that strip, wrapping.

Two consequences that are easy to get wrong:

  • Rows on a reel are not independent draws. Exactly 20 columns per reel are reachable, each a contiguous wrapping triplet. Any formula that multiplies per-row symbol probabilities assumes an independence this model does not have and will be wrong.
  • The base state space is 20⁵ = 3,200,000 grids, not 1720⁵.

COIN layout

Every strip carries a contiguous three-entry COIN run at indices 0–2. The number of visible COIN on a reel therefore depends only on how far the stop lands from that run:

Stop0123–171819
Visible COIN321012

This is the property that makes the trigger frequency exactly analysable rather than merely sampled. Scattering the run would leave every value test passing while this table became fiction. Pinned by TestCoinRunLayout and TestReelWindowCoinCounts.

Reel strips and weights

All five reels have 20 entries and identical weight totals of 1720.

Entry indexesContentsWeight each
0–2COIN, COIN, COIN44
3–1715 interior paying entries100
18–192 wrap entries44

Interior contents are one 17-symbol ring — L1 H1 L2 L3 H2 L4 L1 WILD L2 H3 L3 L4 H4 L1 L2 L3 L4 (L1–L4 ×3 each, H1–H4 ×1 each, WILD ×1) — rotated by 0, 7, 14, 4, 11 on reels 1–5 so the reels are not identical. Entries 18–19 are the last two of the rotated ring.

The five COIN-adjacent stops carry the entire trigger and their weight is its only real lever. P(at least one visible COIN on a reel) = 5 × 44 / 1720 = 12.79%.

5. Symbols and paytable

Line-bet multipliers. See GDD §6 for why WILD carries a 5-entry only.

SymbolType345
WILDwild250
COINbonus
H1regular30110250
H2regular2285190
H3regular1870160
H4regular1555140
L1regular83085
L2regular62370
L3regular52060
L4regular41545

6. Evaluation order

  1. Draw one weighted stop per reel; materialise the 5×3 grid.
  2. Evaluate the 10 paylines; sum the line wins, each divided by 10.
  3. Count visible COIN. If ≥ 6, run the Hold & Win and add its award (a total-bet multiplier, undivided).
  4. Apply the 500× round cap once to the sum.

7. Exact calculation

What is exact, and what is not

mathengine.ExactCalculate refuses the whole config with NotEnumerableError{stochastic_feature} — correctly, because hold_and_win is a stochastic state machine, not a grid-determined feature. Pinned by TestPackIsNotEnumerable.

Exact results are therefore obtained for the two parts that are genuinely enumerable:

QuantityMethod
Base RTP, base σ, base hit frequency, base max winExactCalculate on a copy of the config with Features removed — full enumeration of all 3,200,000 grids
Trigger probability and the initial-locked distributionindependent integer-weight convolution of the five per-reel COIN-count distributions

The conditional feature award is not exact and is never presented as such.

Exact trigger probability

For each reel, the total integer weight of the stops showing each visible-COIN count is accumulated, then the five per-reel distributions are convolved. All arithmetic is int64: the denominator is 1720⁵ = 15,036,246,323,200,000, comfortably inside int64, so there is no floating-point rounding anywhere in the derivation. Probability mass is verified twice — by exact integer equality against the denominator, and as a float within 1e-12.

The same routine reproduces hold_and_win_reference's documented 1 in 155.4035 exactly, which is the check that the method matches the engine's reel model rather than a plausible model of it.

Result: P(trigger) = 0.0126493391, i.e. 1 in 79.0555 paid rounds.

Exact distribution of initially locked cells

Initial locked6789101112131415
P(· | trigger)0.6842650.2051440.0810240.0224990.0052370.0014930.0002860.0000430.0000090.000001

E[initial locked | trigger] = 6.4652.

Exact base results

QuantityValue
States enumerated3,200,000
Probability mass1 within 1e-12
Base RTP0.559961 (55.9961%)
Base hit frequency0.293886
Base σ per round1.625286
Base maximum win64.0000×
Base cap probability0

8. RTP decomposition

Total RTP = exact base RTP + exact P(trigger) × E[Hold & Win award | trigger]
          = 0.559961      + 0.0126493391      × 31.6252
          = 0.559961      + 0.400038
          = 0.959998        (95.9998%)
TermMethodValue
Base RTPEXACT55.9961%
P(trigger)EXACT0.0126493391
E[award | trigger]estimated, 1,000,000 features31.6252× ± 0.0202
Feature contributionhybrid40.0038%
Total RTPhybrid95.9998%

Substituting sampled values for the two terms already known by enumeration would only add variance; the all-simulated cross-check is reported separately in ../evidence/simulation/draft-v0.1.md.

Base balancing against the design target

The approved design targeted a 55.44% base RTP, derived from the reference harness's 32.4461× conditional mean. That mean is a property of the harness's distribution of initial locked cells (E = 6.7322), not of the mechanic alone. Magic Vault enters the identical mechanic with E = 6.4652 and measures 31.6252×.

Re-deriving the requirement:

required base RTP = 0.96 − 0.0126493391 × 31.6252 = 0.559962  (55.9962%)

The base paytable was retuned to that figure — four low-symbol entries moved (L1 ×4, L2 ×4, L3 ×4 and ×5). No Hold & Win parameter was changed. This is base balancing, not mechanic tuning. Recorded in ../changelog.md.

9. Feature model

State machine, prize tables and settlement are hold_and_win/v1 exactly as accepted; see the GDD §8 for the player-facing statement and hold_and_win_reference's Final math for the mechanic derivation. Magic Vault changes only Columns: 5, Rows: 3.

Closed forms that carry over unchanged: E[regular coin] = 349/100 = 3.49×, E[prize] = 3915/1026 ≈ 3.815789×.

What does not carry over: the conditional mean, the full-grid rate and the feature RTP contribution, all of which depend on the entering distribution of locked cells.

10. RNG and replay contract

  • Round seed: <seed>:<roundIndex>.
  • Feature seed: HoldAndWinFeatureSeed(roundSeed) = roundSeed + ":hold_and_win".
  • Start sub-seed: featureSeed + ":hold_and_win:start".
  • Step sub-seed: featureSeed + ":hold_and_win:step:<stepIndex>".
  • Step identity: replayIdentity + ":step:<stepIndex>".
  • A non-triggering round consumes no feature randomness.
  • Start draws only for cells already showing COIN; a step draws only for empty cells, in cell index order. A locked cell is skipped before any draw, so the draw count equals the empty cell count exactly.
  • Prize draw order is kind first, then value only if the kind is regular.

TestStepExecutionEqualsRunToCompletion rederives all of these by hand and proves that one-step-at-a-time execution and whole-feature execution produce byte-identical cells and awards on the 5×3 layout.

11. Monte Carlo specification

RunSeedSizePurpose
Whole-game confirmationmagic-vault-draft-v0.1-confirmation2,000,000 rounds, 8 shardscross-check, containment, dispersion
Feature-conditionedmagic-vault-draft-v0.1-feature-confirmation1,000,000 featuresthe conditional mean used above

Feature initial states are drawn from Magic Vault's own exact trigger distribution — the sampler draws per-reel stops from P(stops | total visible COIN ≥ 6) and its empirical distribution of initial locked cells is checked against the exact one at every count. Results in ../evidence/simulation/draft-v0.1.md.

12. Max-win analysis

ClaimMethodResult
500× is reachabledeterministic witnessfull grid settles at exactly 500×
Base alone cannot reach the capEXACT enumerationbase maximum 64.0000×, cap probability 0
Ordinary feature settlement is containeddeterministic witnessa 1,400× coin sum clamps to 500×
Nothing observed above the cap2,000,000 rounds + 1,000,000 featuresmax 500.0000× in both

This is a reachable-value proof plus a containment argument, not an exhaustive proof: the engine's exact max-win calculator does not cover a stateful stochastic feature. Detail in ../evidence/max-win/draft-v0.1.md.

13. Open, locked and tuned parameters

ParameterState
Grid, paylines, symbol set, wild/coin rules, trigger count, carry-overLOCKED by design
All hold_and_win/v1 economics (respins, PPM, coin values/weights, prize weights, Grand, caps)LOCKED, reused unchanged
Round cap 500×LOCKED
COIN run position (indices 0–2)LOCKED by the analysability argument in §4
COIN entry weight (44) and interior weight (100)TUNED in Draft v0.1; open
Interior ring composition and per-reel rotationTUNED; open
H/L/WILD payoutsTUNED; open

14. Known limitations and risks

  1. Not exactly enumerable end to end. The feature term is a Monte Carlo estimate with a standard error of 0.0202× on the conditional mean. The total RTP inherits that uncertainty.
  2. The all-simulated total is a weak check at this sample size. At 2,000,000 rounds its standard error is 0.32 percentage points — wider than the ±0.30pp acceptance band. It is reported as a compatibility check, not as the acceptance measurement.
  3. WILD 3- and 4-of-a-kind are unreachable under the shared LinesEvaluator (§5, GDD §6). If the product wants those rows to pay, the evaluator must change — a shared-engine decision, not a pack decision.
  4. The full-grid rate is estimated from few events in the whole-game run (27 of 25,125). The feature-conditioned run's 0.0743% ± 0.0027% is the figure to rely on.
  5. No runtime parity corpus. Magic Vault is not registered in libs/mathengine/parity; recording new vectors is out of Draft scope. Reference↔runtime parity for this game is therefore unproven and is a prerequisite for any Final.
  6. Shared-evaluator exactness is internal. The exact base figures come from the same engine that executes the game; they are internally exact, not independent verification.
  7. Not certified. No external laboratory has reviewed this math.

15. Draft status

draft-v0.1. Not frozen, not published, not routed, no feature flag, no deployment. Tuning, runtime handoff, parity vectors and any Final version require separate explicit approval.