royalesim 0.1.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. royalesim-0.1.11/LICENSE +27 -0
  2. royalesim-0.1.11/PKG-INFO +60 -0
  3. royalesim-0.1.11/README.md +40 -0
  4. royalesim-0.1.11/crates/royalesim/Cargo.lock +254 -0
  5. royalesim-0.1.11/crates/royalesim/Cargo.toml +53 -0
  6. royalesim-0.1.11/crates/royalesim/build.rs +75 -0
  7. royalesim-0.1.11/crates/royalesim/examples/replay_parity/harness.rs +3100 -0
  8. royalesim-0.1.11/crates/royalesim/examples/replay_parity.rs +187 -0
  9. royalesim-0.1.11/crates/royalesim/src/arena.rs +1444 -0
  10. royalesim-0.1.11/crates/royalesim/src/card.rs +14329 -0
  11. royalesim-0.1.11/crates/royalesim/src/collide.rs +259 -0
  12. royalesim-0.1.11/crates/royalesim/src/combat.rs +2887 -0
  13. royalesim-0.1.11/crates/royalesim/src/entity.rs +1336 -0
  14. royalesim-0.1.11/crates/royalesim/src/fixed.rs +302 -0
  15. royalesim-0.1.11/crates/royalesim/src/formation.rs +487 -0
  16. royalesim-0.1.11/crates/royalesim/src/jump16402.rs +139 -0
  17. royalesim-0.1.11/crates/royalesim/src/lib.rs +385 -0
  18. royalesim-0.1.11/crates/royalesim/src/move16402.rs +1159 -0
  19. royalesim-0.1.11/crates/royalesim/src/path.rs +988 -0
  20. royalesim-0.1.11/crates/royalesim/src/path16402.rs +783 -0
  21. royalesim-0.1.11/crates/royalesim/src/path2026.rs +1393 -0
  22. royalesim-0.1.11/crates/royalesim/src/py.rs +3079 -0
  23. royalesim-0.1.11/crates/royalesim/src/spell.rs +2228 -0
  24. royalesim-0.1.11/crates/royalesim/src/state.rs +31753 -0
  25. royalesim-0.1.11/crates/royalesim/src/status.rs +516 -0
  26. royalesim-0.1.11/crates/royalesim/src/target.rs +1326 -0
  27. royalesim-0.1.11/crates/royalesim/tests/action_group_spawn_order.rs +66 -0
  28. royalesim-0.1.11/crates/royalesim/tests/api.rs +165 -0
  29. royalesim-0.1.11/crates/royalesim/tests/archer_queen_cape.rs +95 -0
  30. royalesim-0.1.11/crates/royalesim/tests/area_buff_time16402.rs +128 -0
  31. royalesim-0.1.11/crates/royalesim/tests/attack_facing.rs +78 -0
  32. royalesim-0.1.11/crates/royalesim/tests/attract_onset.rs +89 -0
  33. royalesim-0.1.11/crates/royalesim/tests/attract_water_edge.rs +64 -0
  34. royalesim-0.1.11/crates/royalesim/tests/avoidance_drop_segment.rs +155 -0
  35. royalesim-0.1.11/crates/royalesim/tests/avoidance_tie_order.rs +118 -0
  36. royalesim-0.1.11/crates/royalesim/tests/barb_log.rs +107 -0
  37. royalesim-0.1.11/crates/royalesim/tests/barrage_reach.rs +76 -0
  38. royalesim-0.1.11/crates/royalesim/tests/battle.rs +220 -0
  39. royalesim-0.1.11/crates/royalesim/tests/boss_bandit.rs +151 -0
  40. royalesim-0.1.11/crates/royalesim/tests/building_spell_reach.rs +104 -0
  41. royalesim-0.1.11/crates/royalesim/tests/cage_captive_shots.rs +102 -0
  42. royalesim-0.1.11/crates/royalesim/tests/cast_hold_heading.rs +73 -0
  43. royalesim-0.1.11/crates/royalesim/tests/chain_landed_body.rs +98 -0
  44. royalesim-0.1.11/crates/royalesim/tests/chained_hits.rs +103 -0
  45. royalesim-0.1.11/crates/royalesim/tests/charge.rs +1110 -0
  46. royalesim-0.1.11/crates/royalesim/tests/chase_drop_growing_away.rs +188 -0
  47. royalesim-0.1.11/crates/royalesim/tests/chase_drop_knocked.rs +153 -0
  48. royalesim-0.1.11/crates/royalesim/tests/chase_drop_measure.rs +74 -0
  49. royalesim-0.1.11/crates/royalesim/tests/chase_drop_walking_away.rs +114 -0
  50. royalesim-0.1.11/crates/royalesim/tests/chase_hold.rs +112 -0
  51. royalesim-0.1.11/crates/royalesim/tests/chase_hold_scope.rs +104 -0
  52. royalesim-0.1.11/crates/royalesim/tests/chase_rescan_pass_over.rs +88 -0
  53. royalesim-0.1.11/crates/royalesim/tests/clone.rs +570 -0
  54. royalesim-0.1.11/crates/royalesim/tests/clone_copy_deploy.rs +133 -0
  55. royalesim-0.1.11/crates/royalesim/tests/command_delay.rs +177 -0
  56. royalesim-0.1.11/crates/royalesim/tests/common/mod.rs +990 -0
  57. royalesim-0.1.11/crates/royalesim/tests/corpse_switch_reach.rs +161 -0
  58. royalesim-0.1.11/crates/royalesim/tests/crown_tower_spell_reach.rs +77 -0
  59. royalesim-0.1.11/crates/royalesim/tests/curse.rs +416 -0
  60. royalesim-0.1.11/crates/royalesim/tests/dark_magic.rs +366 -0
  61. royalesim-0.1.11/crates/royalesim/tests/dash_attack.rs +450 -0
  62. royalesim-0.1.11/crates/royalesim/tests/dash_chain_aim.rs +70 -0
  63. royalesim-0.1.11/crates/royalesim/tests/dash_chain_immunity.rs +71 -0
  64. royalesim-0.1.11/crates/royalesim/tests/dash_first_sight_trigger.rs +136 -0
  65. royalesim-0.1.11/crates/royalesim/tests/dash_pushback.rs +129 -0
  66. royalesim-0.1.11/crates/royalesim/tests/data/hash_continuity.json +926 -0
  67. royalesim-0.1.11/crates/royalesim/tests/death_area_effect.rs +470 -0
  68. royalesim-0.1.11/crates/royalesim/tests/death_bomb.rs +337 -0
  69. royalesim-0.1.11/crates/royalesim/tests/death_bomb_timing_scope.rs +107 -0
  70. royalesim-0.1.11/crates/royalesim/tests/death_damage_tick.rs +63 -0
  71. royalesim-0.1.11/crates/royalesim/tests/death_ring_axis.rs +118 -0
  72. royalesim-0.1.11/crates/royalesim/tests/death_ring_order.rs +57 -0
  73. royalesim-0.1.11/crates/royalesim/tests/death_slide_aim.rs +346 -0
  74. royalesim-0.1.11/crates/royalesim/tests/death_slide_birth.rs +151 -0
  75. royalesim-0.1.11/crates/royalesim/tests/death_slide_stop.rs +120 -0
  76. royalesim-0.1.11/crates/royalesim/tests/death_spawn_at_emission.rs +28 -0
  77. royalesim-0.1.11/crates/royalesim/tests/death_spawn_pushback.rs +614 -0
  78. royalesim-0.1.11/crates/royalesim/tests/deploy_area_effect_deploy_time.rs +97 -0
  79. royalesim-0.1.11/crates/royalesim/tests/deploy_effects.rs +160 -0
  80. royalesim-0.1.11/crates/royalesim/tests/deploying_heading.rs +104 -0
  81. royalesim-0.1.11/crates/royalesim/tests/direct_hit_buff_countdown.rs +59 -0
  82. royalesim-0.1.11/crates/royalesim/tests/dismount_river.rs +120 -0
  83. royalesim-0.1.11/crates/royalesim/tests/doomed_drop_swing.rs +171 -0
  84. royalesim-0.1.11/crates/royalesim/tests/doomed_lane_tower.rs +197 -0
  85. royalesim-0.1.11/crates/royalesim/tests/doomed_own_update.rs +73 -0
  86. royalesim-0.1.11/crates/royalesim/tests/doomed_target_drop.rs +291 -0
  87. royalesim-0.1.11/crates/royalesim/tests/elixir_collector.rs +416 -0
  88. royalesim-0.1.11/crates/royalesim/tests/elixir_golem_split.rs +194 -0
  89. royalesim-0.1.11/crates/royalesim/tests/embedded_cards.rs +24 -0
  90. royalesim-0.1.11/crates/royalesim/tests/enchant.rs +893 -0
  91. royalesim-0.1.11/crates/royalesim/tests/entity_level.rs +263 -0
  92. royalesim-0.1.11/crates/royalesim/tests/equal_distance_tie.rs +126 -0
  93. royalesim-0.1.11/crates/royalesim/tests/evo_archer.rs +87 -0
  94. royalesim-0.1.11/crates/royalesim/tests/evo_baby_dragon.rs +156 -0
  95. royalesim-0.1.11/crates/royalesim/tests/evo_barbarians.rs +62 -0
  96. royalesim-0.1.11/crates/royalesim/tests/evo_bats.rs +89 -0
  97. royalesim-0.1.11/crates/royalesim/tests/evo_battle_ram.rs +231 -0
  98. royalesim-0.1.11/crates/royalesim/tests/evo_bomber.rs +140 -0
  99. royalesim-0.1.11/crates/royalesim/tests/evo_chain_hop_wait.rs +84 -0
  100. royalesim-0.1.11/crates/royalesim/tests/evo_chain_shot_launch.rs +80 -0
  101. royalesim-0.1.11/crates/royalesim/tests/evo_copy_count.rs +81 -0
  102. royalesim-0.1.11/crates/royalesim/tests/evo_dart_goblin.rs +68 -0
  103. royalesim-0.1.11/crates/royalesim/tests/evo_electro_dragon.rs +81 -0
  104. royalesim-0.1.11/crates/royalesim/tests/evo_elite_barbarians.rs +198 -0
  105. royalesim-0.1.11/crates/royalesim/tests/evo_executioner.rs +110 -0
  106. royalesim-0.1.11/crates/royalesim/tests/evo_firecracker.rs +77 -0
  107. royalesim-0.1.11/crates/royalesim/tests/evo_furnace.rs +173 -0
  108. royalesim-0.1.11/crates/royalesim/tests/evo_goblin_barrel.rs +70 -0
  109. royalesim-0.1.11/crates/royalesim/tests/evo_goblin_cage.rs +207 -0
  110. royalesim-0.1.11/crates/royalesim/tests/evo_goblin_drill.rs +127 -0
  111. royalesim-0.1.11/crates/royalesim/tests/evo_goblin_giant.rs +88 -0
  112. royalesim-0.1.11/crates/royalesim/tests/evo_hunter.rs +108 -0
  113. royalesim-0.1.11/crates/royalesim/tests/evo_ice_spirits.rs +79 -0
  114. royalesim-0.1.11/crates/royalesim/tests/evo_inferno_dragon.rs +154 -0
  115. royalesim-0.1.11/crates/royalesim/tests/evo_knight.rs +60 -0
  116. royalesim-0.1.11/crates/royalesim/tests/evo_lumberjack.rs +123 -0
  117. royalesim-0.1.11/crates/royalesim/tests/evo_mega_knight.rs +85 -0
  118. royalesim-0.1.11/crates/royalesim/tests/evo_minion_horde.rs +128 -0
  119. royalesim-0.1.11/crates/royalesim/tests/evo_mortar.rs +92 -0
  120. royalesim-0.1.11/crates/royalesim/tests/evo_musketeer_snipe.rs +249 -0
  121. royalesim-0.1.11/crates/royalesim/tests/evo_pekka.rs +106 -0
  122. royalesim-0.1.11/crates/royalesim/tests/evo_princess.rs +101 -0
  123. royalesim-0.1.11/crates/royalesim/tests/evo_royal_ghost.rs +154 -0
  124. royalesim-0.1.11/crates/royalesim/tests/evo_royal_giant.rs +91 -0
  125. royalesim-0.1.11/crates/royalesim/tests/evo_royal_hogs.rs +154 -0
  126. royalesim-0.1.11/crates/royalesim/tests/evo_royal_recruits.rs +80 -0
  127. royalesim-0.1.11/crates/royalesim/tests/evo_skeleton_army.rs +244 -0
  128. royalesim-0.1.11/crates/royalesim/tests/evo_skeleton_barrel.rs +125 -0
  129. royalesim-0.1.11/crates/royalesim/tests/evo_snowball.rs +174 -0
  130. royalesim-0.1.11/crates/royalesim/tests/evo_tesla.rs +112 -0
  131. royalesim-0.1.11/crates/royalesim/tests/evo_valkyrie.rs +135 -0
  132. royalesim-0.1.11/crates/royalesim/tests/evo_wall_breakers.rs +110 -0
  133. royalesim-0.1.11/crates/royalesim/tests/evo_witch.rs +175 -0
  134. royalesim-0.1.11/crates/royalesim/tests/evo_wizard.rs +66 -0
  135. royalesim-0.1.11/crates/royalesim/tests/evo_zap.rs +142 -0
  136. royalesim-0.1.11/crates/royalesim/tests/evolution.rs +667 -0
  137. royalesim-0.1.11/crates/royalesim/tests/fall_and_resume.rs +197 -0
  138. royalesim-0.1.11/crates/royalesim/tests/fall_grounding.rs +139 -0
  139. royalesim-0.1.11/crates/royalesim/tests/fallen_lane_tower_pick.rs +150 -0
  140. royalesim-0.1.11/crates/royalesim/tests/far_area_hit.rs +82 -0
  141. royalesim-0.1.11/crates/royalesim/tests/far_building_scan.rs +80 -0
  142. royalesim-0.1.11/crates/royalesim/tests/first_step_dying_bodies.rs +199 -0
  143. royalesim-0.1.11/crates/royalesim/tests/first_step_dying_contact.rs +148 -0
  144. royalesim-0.1.11/crates/royalesim/tests/fixtures/formations/measured.json +3431 -0
  145. royalesim-0.1.11/crates/royalesim/tests/fixtures/live_levels.json +1176 -0
  146. royalesim-0.1.11/crates/royalesim/tests/fixtures/oracle2026/client16402_first_paths.json +140201 -0
  147. royalesim-0.1.11/crates/royalesim/tests/fixtures/oracle2026/client16402_jumps.json +18581 -0
  148. royalesim-0.1.11/crates/royalesim/tests/fixtures/oracle2026/first_paths.json +6401 -0
  149. royalesim-0.1.11/crates/royalesim/tests/fixtures/replay/sample.json +1 -0
  150. royalesim-0.1.11/crates/royalesim/tests/fixtures/snap_384_tick2970.bin +1 -0
  151. royalesim-0.1.11/crates/royalesim/tests/fixtures/spell_impacts.json +864 -0
  152. royalesim-0.1.11/crates/royalesim/tests/fly_direct_paths.rs +64 -0
  153. royalesim-0.1.11/crates/royalesim/tests/formations.rs +756 -0
  154. royalesim-0.1.11/crates/royalesim/tests/furnace.rs +294 -0
  155. royalesim-0.1.11/crates/royalesim/tests/ghost_pair_first_frame.rs +63 -0
  156. royalesim-0.1.11/crates/royalesim/tests/goal_target.rs +160 -0
  157. royalesim-0.1.11/crates/royalesim/tests/goblin_curse.rs +497 -0
  158. royalesim-0.1.11/crates/royalesim/tests/goblin_giant.rs +243 -0
  159. royalesim-0.1.11/crates/royalesim/tests/goblin_hut.rs +114 -0
  160. royalesim-0.1.11/crates/royalesim/tests/goblinstein.rs +111 -0
  161. royalesim-0.1.11/crates/royalesim/tests/golden_knight.rs +381 -0
  162. royalesim-0.1.11/crates/royalesim/tests/hand_refill.rs +160 -0
  163. royalesim-0.1.11/crates/royalesim/tests/hash_continuity.rs +824 -0
  164. royalesim-0.1.11/crates/royalesim/tests/held_facing.rs +81 -0
  165. royalesim-0.1.11/crates/royalesim/tests/held_route.rs +61 -0
  166. royalesim-0.1.11/crates/royalesim/tests/held_unit_avoidance.rs +150 -0
  167. royalesim-0.1.11/crates/royalesim/tests/held_unit_contact.rs +255 -0
  168. royalesim-0.1.11/crates/royalesim/tests/held_waypoint_test.rs +74 -0
  169. royalesim-0.1.11/crates/royalesim/tests/hero_balloon.rs +189 -0
  170. royalesim-0.1.11/crates/royalesim/tests/hero_barbarian_barrel.rs +87 -0
  171. royalesim-0.1.11/crates/royalesim/tests/hero_berserker.rs +315 -0
  172. royalesim-0.1.11/crates/royalesim/tests/hero_bowler.rs +151 -0
  173. royalesim-0.1.11/crates/royalesim/tests/hero_dark_prince.rs +223 -0
  174. royalesim-0.1.11/crates/royalesim/tests/hero_forms.rs +743 -0
  175. royalesim-0.1.11/crates/royalesim/tests/hero_giant.rs +156 -0
  176. royalesim-0.1.11/crates/royalesim/tests/hero_goblins.rs +212 -0
  177. royalesim-0.1.11/crates/royalesim/tests/hero_knight.rs +176 -0
  178. royalesim-0.1.11/crates/royalesim/tests/hero_magic_archer.rs +219 -0
  179. royalesim-0.1.11/crates/royalesim/tests/hero_mega_minion.rs +167 -0
  180. royalesim-0.1.11/crates/royalesim/tests/hero_mini_pekka.rs +245 -0
  181. royalesim-0.1.11/crates/royalesim/tests/hero_newest_copy.rs +106 -0
  182. royalesim-0.1.11/crates/royalesim/tests/hero_tombstone.rs +183 -0
  183. royalesim-0.1.11/crates/royalesim/tests/hero_turret.rs +297 -0
  184. royalesim-0.1.11/crates/royalesim/tests/hero_valkyrie.rs +266 -0
  185. royalesim-0.1.11/crates/royalesim/tests/hero_wizard.rs +200 -0
  186. royalesim-0.1.11/crates/royalesim/tests/hide.rs +999 -0
  187. royalesim-0.1.11/crates/royalesim/tests/hook_buildings.rs +100 -0
  188. royalesim-0.1.11/crates/royalesim/tests/hook_drag_route.rs +137 -0
  189. royalesim-0.1.11/crates/royalesim/tests/hook_first_strike.rs +73 -0
  190. royalesim-0.1.11/crates/royalesim/tests/hook_landing.rs +81 -0
  191. royalesim-0.1.11/crates/royalesim/tests/hook_release.rs +72 -0
  192. royalesim-0.1.11/crates/royalesim/tests/hook_transform.rs +207 -0
  193. royalesim-0.1.11/crates/royalesim/tests/idle_buff.rs +218 -0
  194. royalesim-0.1.11/crates/royalesim/tests/illegal_troop_tap.rs +101 -0
  195. royalesim-0.1.11/crates/royalesim/tests/invisibility.rs +163 -0
  196. royalesim-0.1.11/crates/royalesim/tests/jump16402.rs +563 -0
  197. royalesim-0.1.11/crates/royalesim/tests/jump_landing_contact.rs +91 -0
  198. royalesim-0.1.11/crates/royalesim/tests/jump_landing_scope.rs +96 -0
  199. royalesim-0.1.11/crates/royalesim/tests/kamikaze_contact.rs +61 -0
  200. royalesim-0.1.11/crates/royalesim/tests/kamikaze_launch_pass.rs +58 -0
  201. royalesim-0.1.11/crates/royalesim/tests/king_area_spawn_unit.rs +46 -0
  202. royalesim-0.1.11/crates/royalesim/tests/knockback.rs +397 -0
  203. royalesim-0.1.11/crates/royalesim/tests/knockback16402.rs +787 -0
  204. royalesim-0.1.11/crates/royalesim/tests/knocked_doomed_avoidance.rs +89 -0
  205. royalesim-0.1.11/crates/royalesim/tests/knocked_target_hold.rs +74 -0
  206. royalesim-0.1.11/crates/royalesim/tests/ladder_end_route.rs +68 -0
  207. royalesim-0.1.11/crates/royalesim/tests/launch_past_target.rs +65 -0
  208. royalesim-0.1.11/crates/royalesim/tests/legacy_avoidance.rs +160 -0
  209. royalesim-0.1.11/crates/royalesim/tests/levels.rs +272 -0
  210. royalesim-0.1.11/crates/royalesim/tests/life_state_aim.rs +190 -0
  211. royalesim-0.1.11/crates/royalesim/tests/life_state_wave.rs +144 -0
  212. royalesim-0.1.11/crates/royalesim/tests/lifetime.rs +481 -0
  213. royalesim-0.1.11/crates/royalesim/tests/line_frame.rs +53 -0
  214. royalesim-0.1.11/crates/royalesim/tests/line_placement.rs +149 -0
  215. royalesim-0.1.11/crates/royalesim/tests/little_prince.rs +252 -0
  216. royalesim-0.1.11/crates/royalesim/tests/live_bottle_taps.rs +151 -0
  217. royalesim-0.1.11/crates/royalesim/tests/load_first_hit_kill_wait.rs +80 -0
  218. royalesim-0.1.11/crates/royalesim/tests/load_first_hit_leave.rs +87 -0
  219. royalesim-0.1.11/crates/royalesim/tests/load_timer_target_loss.rs +214 -0
  220. royalesim-0.1.11/crates/royalesim/tests/loadable_census.rs +672 -0
  221. royalesim-0.1.11/crates/royalesim/tests/lost_target_swing.rs +90 -0
  222. royalesim-0.1.11/crates/royalesim/tests/lumberjack.rs +198 -0
  223. royalesim-0.1.11/crates/royalesim/tests/mana_on_death.rs +176 -0
  224. royalesim-0.1.11/crates/royalesim/tests/mechanics.rs +854 -0
  225. royalesim-0.1.11/crates/royalesim/tests/mighty_miner.rs +138 -0
  226. royalesim-0.1.11/crates/royalesim/tests/minion_giant.rs +44 -0
  227. royalesim-0.1.11/crates/royalesim/tests/mirror.rs +1120 -0
  228. royalesim-0.1.11/crates/royalesim/tests/mirror_card.rs +281 -0
  229. royalesim-0.1.11/crates/royalesim/tests/monk_combo.rs +202 -0
  230. royalesim-0.1.11/crates/royalesim/tests/monk_deflect.rs +261 -0
  231. royalesim-0.1.11/crates/royalesim/tests/net_initial_cooldown.rs +95 -0
  232. royalesim-0.1.11/crates/royalesim/tests/observable.rs +187 -0
  233. royalesim-0.1.11/crates/royalesim/tests/oracle2026.rs +708 -0
  234. royalesim-0.1.11/crates/royalesim/tests/own_building_taps.rs +257 -0
  235. royalesim-0.1.11/crates/royalesim/tests/parry.rs +903 -0
  236. royalesim-0.1.11/crates/royalesim/tests/pass_kill_chase.rs +126 -0
  237. royalesim-0.1.11/crates/royalesim/tests/pellet_building_reach.rs +55 -0
  238. royalesim-0.1.11/crates/royalesim/tests/placement.rs +278 -0
  239. royalesim-0.1.11/crates/royalesim/tests/post_kill_wait.rs +78 -0
  240. royalesim-0.1.11/crates/royalesim/tests/post_kill_wait_heading.rs +110 -0
  241. royalesim-0.1.11/crates/royalesim/tests/press_route.rs +71 -0
  242. royalesim-0.1.11/crates/royalesim/tests/projectile_hold_scope.rs +219 -0
  243. royalesim-0.1.11/crates/royalesim/tests/projectile_y_offset.rs +233 -0
  244. royalesim-0.1.11/crates/royalesim/tests/push_load_timer.rs +210 -0
  245. royalesim-0.1.11/crates/royalesim/tests/random_delay_stream.rs +58 -0
  246. royalesim-0.1.11/crates/royalesim/tests/reach.rs +551 -0
  247. royalesim-0.1.11/crates/royalesim/tests/reach_loss_switch.rs +228 -0
  248. royalesim-0.1.11/crates/royalesim/tests/reflect_attack.rs +279 -0
  249. royalesim-0.1.11/crates/royalesim/tests/release_first_update.rs +51 -0
  250. royalesim-0.1.11/crates/royalesim/tests/release_timing.rs +209 -0
  251. royalesim-0.1.11/crates/royalesim/tests/relocation_ties.rs +67 -0
  252. royalesim-0.1.11/crates/royalesim/tests/replay_parity.rs +1223 -0
  253. royalesim-0.1.11/crates/royalesim/tests/retarget_wait_arms.rs +211 -0
  254. royalesim-0.1.11/crates/royalesim/tests/rider.rs +499 -0
  255. royalesim-0.1.11/crates/royalesim/tests/ring_degree.rs +125 -0
  256. royalesim-0.1.11/crates/royalesim/tests/royal_delivery.rs +403 -0
  257. royalesim-0.1.11/crates/royalesim/tests/samepath_segment.rs +129 -0
  258. royalesim-0.1.11/crates/royalesim/tests/save_load.rs +346 -0
  259. royalesim-0.1.11/crates/royalesim/tests/scan_reach.rs +63 -0
  260. royalesim-0.1.11/crates/royalesim/tests/scheduled_area.rs +363 -0
  261. royalesim-0.1.11/crates/royalesim/tests/scheduled_first_update.rs +174 -0
  262. royalesim-0.1.11/crates/royalesim/tests/sequential_strike.rs +293 -0
  263. royalesim-0.1.11/crates/royalesim/tests/setup_spawn_order.rs +147 -0
  264. royalesim-0.1.11/crates/royalesim/tests/shot_at_hiding_building.rs +75 -0
  265. royalesim-0.1.11/crates/royalesim/tests/skeleton_barrel.rs +739 -0
  266. royalesim-0.1.11/crates/royalesim/tests/skeleton_king.rs +417 -0
  267. royalesim-0.1.11/crates/royalesim/tests/slap_flight_targets.rs +100 -0
  268. royalesim-0.1.11/crates/royalesim/tests/snipe_repick.rs +69 -0
  269. royalesim-0.1.11/crates/royalesim/tests/soul_point_base.rs +78 -0
  270. royalesim-0.1.11/crates/royalesim/tests/spawn_acquire_delay.rs +578 -0
  271. royalesim-0.1.11/crates/royalesim/tests/spawn_chain.rs +291 -0
  272. royalesim-0.1.11/crates/royalesim/tests/spawn_pathfind.rs +566 -0
  273. royalesim-0.1.11/crates/royalesim/tests/spawn_pathfind_step.rs +101 -0
  274. royalesim-0.1.11/crates/royalesim/tests/spawn_point_measured.rs +294 -0
  275. royalesim-0.1.11/crates/royalesim/tests/spawn_unit_resolved.rs +169 -0
  276. royalesim-0.1.11/crates/royalesim/tests/spawned_first_step.rs +323 -0
  277. royalesim-0.1.11/crates/royalesim/tests/spawner.rs +1600 -0
  278. royalesim-0.1.11/crates/royalesim/tests/spectral_first_update.rs +68 -0
  279. royalesim-0.1.11/crates/royalesim/tests/spell_summon.rs +380 -0
  280. royalesim-0.1.11/crates/royalesim/tests/spells.rs +1788 -0
  281. royalesim-0.1.11/crates/royalesim/tests/spin_begin.rs +68 -0
  282. royalesim-0.1.11/crates/royalesim/tests/stacked_tie.rs +158 -0
  283. royalesim-0.1.11/crates/royalesim/tests/status.rs +1004 -0
  284. royalesim-0.1.11/crates/royalesim/tests/straight_shot_bodies.rs +249 -0
  285. royalesim-0.1.11/crates/royalesim/tests/strike_timing16402.rs +323 -0
  286. royalesim-0.1.11/crates/royalesim/tests/strike_under_ground.rs +87 -0
  287. royalesim-0.1.11/crates/royalesim/tests/strikes.rs +243 -0
  288. royalesim-0.1.11/crates/royalesim/tests/struck_contact_order.rs +107 -0
  289. royalesim-0.1.11/crates/royalesim/tests/stun_clears_target.rs +68 -0
  290. royalesim-0.1.11/crates/royalesim/tests/suspicious_bush.rs +310 -0
  291. royalesim-0.1.11/crates/royalesim/tests/target_rank_distance.rs +200 -0
  292. royalesim-0.1.11/crates/royalesim/tests/territory.rs +254 -0
  293. royalesim-0.1.11/crates/royalesim/tests/three_musketeers.rs +406 -0
  294. royalesim-0.1.11/crates/royalesim/tests/throughput.rs +135 -0
  295. royalesim-0.1.11/crates/royalesim/tests/tick_order.rs +534 -0
  296. royalesim-0.1.11/crates/royalesim/tests/tiebreak.rs +325 -0
  297. royalesim-0.1.11/crates/royalesim/tests/tower_tap_push.rs +225 -0
  298. royalesim-0.1.11/crates/royalesim/tests/transform.rs +894 -0
  299. royalesim-0.1.11/crates/royalesim/tests/tri_wizards.rs +360 -0
  300. royalesim-0.1.11/crates/royalesim/tests/triple_elixir.rs +51 -0
  301. royalesim-0.1.11/crates/royalesim/tests/troop_death_pushback.rs +83 -0
  302. royalesim-0.1.11/crates/royalesim/tests/troop_relocation_ties.rs +58 -0
  303. royalesim-0.1.11/crates/royalesim/tests/unit_hitpoints.rs +158 -0
  304. royalesim-0.1.11/crates/royalesim/tests/unit_refs.rs +675 -0
  305. royalesim-0.1.11/crates/royalesim/tests/variable_damage_walk_reach.rs +193 -0
  306. royalesim-0.1.11/crates/royalesim/tests/variant_card.rs +319 -0
  307. royalesim-0.1.11/crates/royalesim/tests/vines.rs +377 -0
  308. royalesim-0.1.11/crates/royalesim/tests/walking_keep_reach.rs +100 -0
  309. royalesim-0.1.11/crates/royalesim/tests/warp_hiding.rs +111 -0
  310. royalesim-0.1.11/crates/royalesim/tests/water_landing.rs +146 -0
  311. royalesim-0.1.11/data/calibration.json +5805 -0
  312. royalesim-0.1.11/data/derived/arena.json +2558 -0
  313. royalesim-0.1.11/data/derived/cards-15.535.json +92147 -0
  314. royalesim-0.1.11/data/derived/cards-2018.json +17736 -0
  315. royalesim-0.1.11/data/derived/cards.json +92147 -0
  316. royalesim-0.1.11/data/derived/globals.json +1339 -0
  317. royalesim-0.1.11/data/raw/retroroyale-2018/README.md +8 -0
  318. royalesim-0.1.11/data/raw/retroroyale-2018/csv_logic/globals.csv +446 -0
  319. royalesim-0.1.11/data/raw/retroroyale-2018/csv_logic/rarities.csv +52 -0
  320. royalesim-0.1.11/pyproject.toml +100 -0
  321. royalesim-0.1.11/python/royalesim/__init__.py +31 -0
  322. royalesim-0.1.11/python/royalesim/py.typed +0 -0
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RoyaleGym contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ This licence does not cover the files under data/raw/, which are Supercell game-data tables
26
+ reproduced for interoperability research. They remain Supercell's property and are not licensed
27
+ by this project.
@@ -0,0 +1,60 @@
1
+ Metadata-Version: 2.4
2
+ Name: royalesim
3
+ Version: 0.1.11
4
+ Requires-Dist: numpy>=2.0 ; extra == 'dev'
5
+ Requires-Dist: msgspec>=0.19 ; extra == 'dev'
6
+ Requires-Dist: pytest>=8.0 ; extra == 'dev'
7
+ Requires-Dist: hypothesis>=6.100 ; extra == 'dev'
8
+ Requires-Dist: ruff>=0.16 ; extra == 'dev'
9
+ Requires-Dist: mypy>=2.0 ; extra == 'dev'
10
+ Requires-Dist: maturin>=1.15,<2.0 ; extra == 'dev'
11
+ Requires-Dist: opencv-python>=4.10 ; extra == 'oracle'
12
+ Provides-Extra: dev
13
+ Provides-Extra: oracle
14
+ License-File: LICENSE
15
+ Summary: RoyaleSim: deterministic, integer-only Clash Royale battle engine (Rust, PyO3 binding)
16
+ License: MIT
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
19
+
20
+ <p align="center"><img src="docs/media/logo.png" width="128" alt="The RoyaleSim logo: a red crown shield with a white gear on it, outlined in gold"></p><h1 align="center">RoyaleSim</h1>
21
+
22
+ <p align="center"><a href="https://github.com/RoyaleGym/RoyaleSim/actions/workflows/suite.yml"><img alt="CI" src="https://github.com/RoyaleGym/RoyaleSim/actions/workflows/suite.yml/badge.svg"></a> <img alt="License" src="https://img.shields.io/github/license/RoyaleGym/RoyaleSim?style=flat-square&color=555"> <img alt="Python" src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3776AB?style=flat-square&logo=python&logoColor=white"> <a href="https://royalegym.github.io/RoyaleGym/"><img alt="Docs" src="https://img.shields.io/badge/docs-royalegym.github.io-8957e5?style=flat-square&logo=readthedocs&logoColor=white"></a> <a href="https://discord.gg/4D2BS5JBHP"><img alt="Discord" src="https://img.shields.io/discord/1551699576304705647?style=flat-square&logo=discord&logoColor=white&label=discord&color=5865F2"></a> <img alt="Last commit" src="https://img.shields.io/github/last-commit/RoyaleGym/RoyaleSim?style=flat-square&color=555"></p>
23
+
24
+ <p align="center"><img alt="Engine: Rust, whole numbers only" src="https://img.shields.io/badge/engine-Rust%2C%20whole%20numbers%20only-DEA584?style=flat-square&logo=rust&logoColor=white"> <img alt="Tick: 50 ms, 20 per second" src="https://img.shields.io/badge/tick-50%20ms%2C%2020%20per%20second-555?style=flat-square"> <img alt="Coordinates: 18,000 units to one tile" src="https://img.shields.io/badge/coordinates-18%2C000%20per%20tile-555?style=flat-square"></p>
25
+
26
+ The Clash Royale battle engine your bot plays in. It runs the whole match on your own machine.
27
+ Most people use it through [RoyaleGym](https://github.com/RoyaleGym/RoyaleGym) and never call it directly.
28
+
29
+ <p align="center"><img src="docs/media/battle-page.gif" width="100%" alt="An engine battle in the RoyaleViser viewer, 18 units on the board"></p>
30
+
31
+ ## Install
32
+
33
+ ```bash
34
+ pip install "royalegym[all]"
35
+ ```
36
+
37
+ That installs this engine and everything else. Use Python 3.12. [Install](https://royalegym.github.io/RoyaleGym/install/) has more.
38
+
39
+ ## Try it
40
+
41
+ ```python
42
+ import json, royalesim
43
+
44
+ b = royalesim.Battle(card_names=None, slot_of_k=[[0, 1, 2], [0, 1, 2]])
45
+ ids = {row[0]: i for i, row in enumerate(json.loads(b.catalogue_json()))}
46
+ deck = [ids[n] for n in ["Knight", "Archer", "Goblins", "Giant", "Musketeer", "Fireball", "Arrows", "Skeletons"]]
47
+ b.reset(seed=0, decks=[deck, deck], shuffle=1, start_tick=0, elixir_milli=[5000, 5000], tower_hp=None, spawns=[])
48
+ b.step([], 100) # nobody can play in the opening seconds
49
+ r = b.step([(0, 0, 9000 * 18, 10000 * 18)], 20) # blue plays its first card, then 20 ticks pass
50
+ print(json.loads(b.state_json())["tick"], royalesim.DEPLOY_REASONS[r[0][1]]) # 120 OK
51
+ ```
52
+
53
+ ## Next
54
+
55
+ - The engine's Python API: [API](https://royalegym.github.io/RoyaleGym/repos/royalesim/api/)
56
+ - How it works inside, how fast and how accurate it is, building from source: [Engine](https://royalegym.github.io/RoyaleGym/repos/royalesim/engine/)
57
+ - Questions: [Discord](https://discord.gg/4D2BS5JBHP)
58
+
59
+ MIT License.
60
+
@@ -0,0 +1,40 @@
1
+ <p align="center"><img src="docs/media/logo.png" width="128" alt="The RoyaleSim logo: a red crown shield with a white gear on it, outlined in gold"></p><h1 align="center">RoyaleSim</h1>
2
+
3
+ <p align="center"><a href="https://github.com/RoyaleGym/RoyaleSim/actions/workflows/suite.yml"><img alt="CI" src="https://github.com/RoyaleGym/RoyaleSim/actions/workflows/suite.yml/badge.svg"></a> <img alt="License" src="https://img.shields.io/github/license/RoyaleGym/RoyaleSim?style=flat-square&color=555"> <img alt="Python" src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3776AB?style=flat-square&logo=python&logoColor=white"> <a href="https://royalegym.github.io/RoyaleGym/"><img alt="Docs" src="https://img.shields.io/badge/docs-royalegym.github.io-8957e5?style=flat-square&logo=readthedocs&logoColor=white"></a> <a href="https://discord.gg/4D2BS5JBHP"><img alt="Discord" src="https://img.shields.io/discord/1551699576304705647?style=flat-square&logo=discord&logoColor=white&label=discord&color=5865F2"></a> <img alt="Last commit" src="https://img.shields.io/github/last-commit/RoyaleGym/RoyaleSim?style=flat-square&color=555"></p>
4
+
5
+ <p align="center"><img alt="Engine: Rust, whole numbers only" src="https://img.shields.io/badge/engine-Rust%2C%20whole%20numbers%20only-DEA584?style=flat-square&logo=rust&logoColor=white"> <img alt="Tick: 50 ms, 20 per second" src="https://img.shields.io/badge/tick-50%20ms%2C%2020%20per%20second-555?style=flat-square"> <img alt="Coordinates: 18,000 units to one tile" src="https://img.shields.io/badge/coordinates-18%2C000%20per%20tile-555?style=flat-square"></p>
6
+
7
+ The Clash Royale battle engine your bot plays in. It runs the whole match on your own machine.
8
+ Most people use it through [RoyaleGym](https://github.com/RoyaleGym/RoyaleGym) and never call it directly.
9
+
10
+ <p align="center"><img src="docs/media/battle-page.gif" width="100%" alt="An engine battle in the RoyaleViser viewer, 18 units on the board"></p>
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install "royalegym[all]"
16
+ ```
17
+
18
+ That installs this engine and everything else. Use Python 3.12. [Install](https://royalegym.github.io/RoyaleGym/install/) has more.
19
+
20
+ ## Try it
21
+
22
+ ```python
23
+ import json, royalesim
24
+
25
+ b = royalesim.Battle(card_names=None, slot_of_k=[[0, 1, 2], [0, 1, 2]])
26
+ ids = {row[0]: i for i, row in enumerate(json.loads(b.catalogue_json()))}
27
+ deck = [ids[n] for n in ["Knight", "Archer", "Goblins", "Giant", "Musketeer", "Fireball", "Arrows", "Skeletons"]]
28
+ b.reset(seed=0, decks=[deck, deck], shuffle=1, start_tick=0, elixir_milli=[5000, 5000], tower_hp=None, spawns=[])
29
+ b.step([], 100) # nobody can play in the opening seconds
30
+ r = b.step([(0, 0, 9000 * 18, 10000 * 18)], 20) # blue plays its first card, then 20 ticks pass
31
+ print(json.loads(b.state_json())["tick"], royalesim.DEPLOY_REASONS[r[0][1]]) # 120 OK
32
+ ```
33
+
34
+ ## Next
35
+
36
+ - The engine's Python API: [API](https://royalegym.github.io/RoyaleGym/repos/royalesim/api/)
37
+ - How it works inside, how fast and how accurate it is, building from source: [Engine](https://royalegym.github.io/RoyaleGym/repos/royalesim/engine/)
38
+ - Questions: [Discord](https://discord.gg/4D2BS5JBHP)
39
+
40
+ MIT License.
@@ -0,0 +1,254 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 3
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.5.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
10
+
11
+ [[package]]
12
+ name = "cfg-if"
13
+ version = "1.0.4"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
16
+
17
+ [[package]]
18
+ name = "heck"
19
+ version = "0.5.0"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
22
+
23
+ [[package]]
24
+ name = "indoc"
25
+ version = "2.0.7"
26
+ source = "registry+https://github.com/rust-lang/crates.io-index"
27
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
28
+ dependencies = [
29
+ "rustversion",
30
+ ]
31
+
32
+ [[package]]
33
+ name = "itoa"
34
+ version = "1.0.18"
35
+ source = "registry+https://github.com/rust-lang/crates.io-index"
36
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
37
+
38
+ [[package]]
39
+ name = "libc"
40
+ version = "0.2.189"
41
+ source = "registry+https://github.com/rust-lang/crates.io-index"
42
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
43
+
44
+ [[package]]
45
+ name = "memchr"
46
+ version = "2.8.3"
47
+ source = "registry+https://github.com/rust-lang/crates.io-index"
48
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
49
+
50
+ [[package]]
51
+ name = "memoffset"
52
+ version = "0.9.1"
53
+ source = "registry+https://github.com/rust-lang/crates.io-index"
54
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
55
+ dependencies = [
56
+ "autocfg",
57
+ ]
58
+
59
+ [[package]]
60
+ name = "once_cell"
61
+ version = "1.21.4"
62
+ source = "registry+https://github.com/rust-lang/crates.io-index"
63
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
64
+
65
+ [[package]]
66
+ name = "portable-atomic"
67
+ version = "1.15.0"
68
+ source = "registry+https://github.com/rust-lang/crates.io-index"
69
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
70
+
71
+ [[package]]
72
+ name = "proc-macro2"
73
+ version = "1.0.107"
74
+ source = "registry+https://github.com/rust-lang/crates.io-index"
75
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
76
+ dependencies = [
77
+ "unicode-ident",
78
+ ]
79
+
80
+ [[package]]
81
+ name = "pyo3"
82
+ version = "0.22.6"
83
+ source = "registry+https://github.com/rust-lang/crates.io-index"
84
+ checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884"
85
+ dependencies = [
86
+ "cfg-if",
87
+ "indoc",
88
+ "libc",
89
+ "memoffset",
90
+ "once_cell",
91
+ "portable-atomic",
92
+ "pyo3-build-config",
93
+ "pyo3-ffi",
94
+ "pyo3-macros",
95
+ "unindent",
96
+ ]
97
+
98
+ [[package]]
99
+ name = "pyo3-build-config"
100
+ version = "0.22.6"
101
+ source = "registry+https://github.com/rust-lang/crates.io-index"
102
+ checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38"
103
+ dependencies = [
104
+ "once_cell",
105
+ "target-lexicon",
106
+ ]
107
+
108
+ [[package]]
109
+ name = "pyo3-ffi"
110
+ version = "0.22.6"
111
+ source = "registry+https://github.com/rust-lang/crates.io-index"
112
+ checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636"
113
+ dependencies = [
114
+ "libc",
115
+ "pyo3-build-config",
116
+ ]
117
+
118
+ [[package]]
119
+ name = "pyo3-macros"
120
+ version = "0.22.6"
121
+ source = "registry+https://github.com/rust-lang/crates.io-index"
122
+ checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453"
123
+ dependencies = [
124
+ "proc-macro2",
125
+ "pyo3-macros-backend",
126
+ "quote",
127
+ "syn 2.0.119",
128
+ ]
129
+
130
+ [[package]]
131
+ name = "pyo3-macros-backend"
132
+ version = "0.22.6"
133
+ source = "registry+https://github.com/rust-lang/crates.io-index"
134
+ checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
135
+ dependencies = [
136
+ "heck",
137
+ "proc-macro2",
138
+ "pyo3-build-config",
139
+ "quote",
140
+ "syn 2.0.119",
141
+ ]
142
+
143
+ [[package]]
144
+ name = "quote"
145
+ version = "1.0.47"
146
+ source = "registry+https://github.com/rust-lang/crates.io-index"
147
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
148
+ dependencies = [
149
+ "proc-macro2",
150
+ ]
151
+
152
+ [[package]]
153
+ name = "royalesim"
154
+ version = "0.1.11"
155
+ dependencies = [
156
+ "pyo3",
157
+ "serde",
158
+ "serde_json",
159
+ ]
160
+
161
+ [[package]]
162
+ name = "rustversion"
163
+ version = "1.0.23"
164
+ source = "registry+https://github.com/rust-lang/crates.io-index"
165
+ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
166
+
167
+ [[package]]
168
+ name = "serde"
169
+ version = "1.0.229"
170
+ source = "registry+https://github.com/rust-lang/crates.io-index"
171
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
172
+ dependencies = [
173
+ "serde_core",
174
+ "serde_derive",
175
+ ]
176
+
177
+ [[package]]
178
+ name = "serde_core"
179
+ version = "1.0.229"
180
+ source = "registry+https://github.com/rust-lang/crates.io-index"
181
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
182
+ dependencies = [
183
+ "serde_derive",
184
+ ]
185
+
186
+ [[package]]
187
+ name = "serde_derive"
188
+ version = "1.0.229"
189
+ source = "registry+https://github.com/rust-lang/crates.io-index"
190
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
191
+ dependencies = [
192
+ "proc-macro2",
193
+ "quote",
194
+ "syn 3.0.5",
195
+ ]
196
+
197
+ [[package]]
198
+ name = "serde_json"
199
+ version = "1.0.151"
200
+ source = "registry+https://github.com/rust-lang/crates.io-index"
201
+ checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
202
+ dependencies = [
203
+ "itoa",
204
+ "memchr",
205
+ "serde",
206
+ "serde_core",
207
+ "zmij",
208
+ ]
209
+
210
+ [[package]]
211
+ name = "syn"
212
+ version = "2.0.119"
213
+ source = "registry+https://github.com/rust-lang/crates.io-index"
214
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
215
+ dependencies = [
216
+ "proc-macro2",
217
+ "quote",
218
+ "unicode-ident",
219
+ ]
220
+
221
+ [[package]]
222
+ name = "syn"
223
+ version = "3.0.5"
224
+ source = "registry+https://github.com/rust-lang/crates.io-index"
225
+ checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9"
226
+ dependencies = [
227
+ "proc-macro2",
228
+ "quote",
229
+ "unicode-ident",
230
+ ]
231
+
232
+ [[package]]
233
+ name = "target-lexicon"
234
+ version = "0.12.16"
235
+ source = "registry+https://github.com/rust-lang/crates.io-index"
236
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
237
+
238
+ [[package]]
239
+ name = "unicode-ident"
240
+ version = "1.0.24"
241
+ source = "registry+https://github.com/rust-lang/crates.io-index"
242
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
243
+
244
+ [[package]]
245
+ name = "unindent"
246
+ version = "0.2.4"
247
+ source = "registry+https://github.com/rust-lang/crates.io-index"
248
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
249
+
250
+ [[package]]
251
+ name = "zmij"
252
+ version = "1.0.23"
253
+ source = "registry+https://github.com/rust-lang/crates.io-index"
254
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
@@ -0,0 +1,53 @@
1
+ [package]
2
+ name = "royalesim"
3
+ version = "0.1.11"
4
+ edition = "2021"
5
+ license = "MIT"
6
+ rust-version = "1.80"
7
+
8
+ [lib]
9
+ name = "royalesim"
10
+ # cdylib: the Python extension. rlib: so benches/tests and other crates can link it.
11
+ crate-type = ["cdylib", "rlib"]
12
+
13
+ [features]
14
+ # CHECKOUT DATA: read data/derived/cards.json from the checkout this crate was built in, at run time, when it exists.
15
+ # On for every build from a checkout (cargo test, maturin develop, the gate), so a regenerated card table is picked up
16
+ # without a rebuild. OFF for a wheel (`maturin build --no-default-features`, .github/workflows/wheels.yml): a wheel
17
+ # runs only its compiled-in table, and never a file at a path from the machine that built it.
18
+ default = ["checkout-data"]
19
+ checkout-data = []
20
+
21
+ [dependencies]
22
+ # abi3-py310: one wheel per platform runs on CPython 3.10 and every later version (the stable ABI).
23
+ pyo3 = { version = "0.22", features = ["extension-module", "abi3-py310"] }
24
+ serde = { version = "1", features = ["derive"] }
25
+ serde_json = "1"
26
+
27
+ [profile.release]
28
+ opt-level = 3
29
+ lto = "fat"
30
+ codegen-units = 1
31
+ panic = "abort"
32
+
33
+ # The determinism profile. Overflow checks stay ON in release, because in an
34
+ # integer engine a silent wrap is a silently wrong battle that no test will
35
+ # attribute to the right cause. The cost is a few percent; the alternative is
36
+ # the class of bug this project cannot afford.
37
+ [profile.release.package.royalesim]
38
+ overflow-checks = true
39
+
40
+ # The TEST GATE's profile (`cargo test --profile gate`): the release optimisation and the overflow checks, without the
41
+ # fat link. Fat LTO with one codegen unit is for the shipped wheel and exe; every test binary paying for it made the
42
+ # full suite take 45 to 87 minutes. An integer engine's results do not depend on how it is linked, and the gate's own
43
+ # hash_continuity check would show it if they did.
44
+ [profile.gate]
45
+ inherits = "release"
46
+ lto = false
47
+ codegen-units = 16
48
+
49
+ [profile.gate.package.royalesim]
50
+ overflow-checks = true
51
+
52
+ [profile.bench]
53
+ inherits = "release"
@@ -0,0 +1,75 @@
1
+ //! Stamp the extension with the source it was built from.
2
+ //!
3
+ //! WHY. The compiled engine is loaded from the venv at runtime, with no checkout around it, so
4
+ //! nothing could answer "was this code the code in the last commit". The data side was already
5
+ //! answerable (the ledger is embedded and compared against the file on disk), and the code side
6
+ //! was not, so a rebuild from a dirty tree was invisible to every guard in the family. On
7
+ //! 2026-09-22 the engine was rebuilt twice from trees with uncommitted changes and no tool could
8
+ //! have said so.
9
+ //!
10
+ //! WHAT IT DOES NOT PROVE. The commit is what `git` reported in the crate directory at build
11
+ //! time. `dirty` covers tracked, modified files under the repo, which is what makes a build
12
+ //! unreproducible in practice; an untracked file that the build reads would not show. When git is
13
+ //! not available at all, both come out "unknown", which a consumer must treat as unknown rather
14
+ //! than as clean.
15
+
16
+ use std::process::Command;
17
+
18
+ fn git(args: &[&str]) -> Option<String> {
19
+ let out = Command::new("git").args(args).output().ok()?;
20
+ if !out.status.success() {
21
+ return None;
22
+ }
23
+ Some(String::from_utf8_lossy(&out.stdout).trim().to_string())
24
+ }
25
+
26
+ fn main() {
27
+ let commit = git(&["rev-parse", "HEAD"]).unwrap_or_else(|| "unknown".into());
28
+ // Tracked files only. `--porcelain` prints one line per changed path, so empty means clean.
29
+ let dirty = match git(&["status", "--porcelain", "--untracked-files=no"]) {
30
+ None => "unknown",
31
+ Some(s) if s.is_empty() => "clean",
32
+ Some(_) => "dirty",
33
+ };
34
+ println!("cargo:rustc-env=ROYALESIM_BUILD_COMMIT={commit}");
35
+ println!("cargo:rustc-env=ROYALESIM_BUILD_TREE={dirty}");
36
+
37
+ // Rebuild the stamp when HEAD moves. The files are found through git, not at `../../.git`:
38
+ // in a linked worktree `.git` is a FILE naming the worktree's own directory, so a fixed
39
+ // `../../.git/HEAD` does not exist there and a commit never re-ran this script. On
40
+ // 2026-09-26 a wheel built in a worktree right after a commit reported the PARENT commit
41
+ // and "dirty" (the stamp left by a `cargo check` run before the commit) while holding the
42
+ // committed code. HEAD and the index live in the worktree's directory (`--git-dir`); the
43
+ // branch a commit moves lives in the shared one (`--git-common-dir`), as a loose ref or in
44
+ // packed-refs. Without git (a fresh archive) none of these exist and the stamp keeps its
45
+ // last value, which is why `provenance()` is documented as best-effort rather than as a
46
+ // guarantee.
47
+ let dir = |flag: &str| git(&["rev-parse", "--path-format=absolute", flag]).map(std::path::PathBuf::from);
48
+ let mut watched = Vec::new();
49
+ if let Some(d) = dir("--git-dir") {
50
+ watched.push(d.join("HEAD"));
51
+ watched.push(d.join("index"));
52
+ }
53
+ if let Some(c) = dir("--git-common-dir") {
54
+ watched.push(c.join("packed-refs"));
55
+ if let Some(branch) = git(&["symbolic-ref", "-q", "HEAD"]) {
56
+ watched.push(c.join(branch));
57
+ }
58
+ }
59
+ for path in watched {
60
+ // A path that does not exist would re-run this script on every build.
61
+ if path.exists() {
62
+ println!("cargo:rerun-if-changed={}", path.display());
63
+ }
64
+ }
65
+ // AND WHEN ANY BUILD INPUT CHANGES. Declaring even one `rerun-if-changed` switches OFF
66
+ // cargo's default of re-running this script on any change in the package, so with only
67
+ // the two git files above an EDITED-BUT-UNSTAGED source file recompiled the crate and left
68
+ // this stamp at its previous value. On 2026-09-24 that shipped a wheel containing
69
+ // uncommitted changes to four files while `provenance()` reported ("a44ef09...", "clean"):
70
+ // the lie this file exists to prevent, told by the file itself. The sources, the manifest
71
+ // and the data the crate `include_str!`s all re-stamp now; a directory is scanned whole.
72
+ for path in ["src", "Cargo.toml", "../../data"] {
73
+ println!("cargo:rerun-if-changed={path}");
74
+ }
75
+ }