Commit Graph
21 Commits
Author SHA1 Message Date
daniel156161 39a7a53873 feat(database): store gameplay replays in compact form
Build and Push Docker Container / build-and-push (push) Successful in 3m52s
- Add compact storage package: codec, records, hydrate, replay blobs, cache.
- Running games write game_turns and snake_states keyed by integer ids.
- Encode moves as 1-byte codes and bodies as head plus step codes.
- Store food and hazards only when they changed since the previous turn.
- Strip reasoning fields that duplicate stored values and restore on read.
- Pack finished games into one zstd blob per game in game_replays.
- Merge late turns into packed blobs during the stale-game sweep.
- Extract SQLite and PostgreSQL schemas into dedicated modules.
- Add read/import game bundle and list_game_ids to the backend template.
- Add legacy readers and converter for the old turns/snake_turns layout.
- Add migrate_gameplay_to_compact.py with in-place or cross-DB migration.
- Verify every migrated game and keep legacy rows on failure.
- Support --since, --minimum-quality and guarded --drop-legacy.
- Add just recipe migrate-gameplay-postgres.
- Rewrite merge script to copy game by game via backend bundles.
- Move benchmark state loading into benchmark_states for both backends.
- Update PostgreSQL cleanup script to the new replay tables.
- Drop sqlite-zstd build stages from the Dockerfile.
- Remove old migration scripts, normalized_turn and their tests.
- Add tests for compact storage, schema, legacy migration and PostgreSQL.
- Document the compact layout and migration workflow in the README.
2026-11-05 00:02:56 +01:00
daniel156161 5efab77248 feat!: adopt Python 3.15 and support BattlesnakeArena
- Require Python 3.15 in project metadata, runtime pin, and Docker stages.
- Use lazy imports for database backends and type-only dependencies.
- Defer benchmark dependencies until their code paths are used.
- Rely on deferred annotations and use Path.info for file discovery.
- Accept BattlesnakeArena alongside BattlesnakeEngine on game endpoints.
- Advance quart_common for Python 3.15 and multi-agent validation.
- Add pytest development dependencies and refresh the uv lockfile.
- Test lazy backend loading, import order, and fresh file discovery.
- Document the runtime requirements and locked uv workflow.

BREAKING CHANGE: Python 3.15 or newer is required; earlier runtimes cannot parse the lazy import syntax.
2026-11-03 10:02:40 +01:00
daniel156161 f14d780f29 feat: add live replays and PostgreSQL maintenance tools
Build and Push Docker Container / build-and-push (push) Successful in 7m53s
- Stream compact live replay updates across local and clustered dashboards.
- Render responsive snake bodies as SVG paths with aligned custom icons.
- Add cache-busted assets, replay fallback routes, and live-follow playback.
- Support PostgreSQL benchmark sampling and idempotent SQLite migration.
- Add dry-run cleanup for old low-quality PostgreSQL replay payloads.
- Reward safe perimeter lanes and bump Prism to version 1.5.0.
- Add backend, migration, dashboard, and perimeter regression coverage.
2026-08-02 00:50:46 +02:00
daniel156161 c646392b84 fix: preserve gameplay data and correct duel evaluation
- Preserve snake customizations across database migrations and merges.
- Lazily load optional storage backends for SQLite maintenance scripts.
- Match Apex territory and nearest-food tie-breaking semantics.
- Resolve duel occupancy after simultaneous movement and food growth.
- Recompute simulated head-to-head danger after body growth.
- Add regression coverage and declare the aiofiles dependency.
2026-08-01 18:16:04 +02:00
daniel156161 4f022d3d01 feat(snake): optimize duels and persist customizations
Build and Push Docker Container / build-and-push (push) Successful in 7m29s
- Add deadline-aware iterative duel search with bitboards and tuple bodies.

- Reuse transposition bounds and move-order hints across search depths.

- Persist snake colors, heads, and tails in SQLite and PostgreSQL.

- Restore customization metadata when hydrating dashboard replays.

- Cover duel deadlines, cache reuse, schema storage, and replay output.
2026-08-01 17:19:35 +02:00
daniel156161 c704fbc742 feat: add Prism snake and gameplay database lifecycle
Build and Push Docker Container / build-and-push (push) Successful in 8m3s
- Add bitboard-accelerated Prism and versioned Supreme snake implementations.
- Add database-backed move benchmarks and focused strategy tests.
- Normalize gameplay storage while preserving replay compatibility.
- Add deterministic game quality scoring and replay retention tiers.
- Add backup-first SQLite cleanup, verification, and replacement tooling.
- Add safe compact-plus-delta database merging with conflict detection.
- Extend SQLite and PostgreSQL schemas for replay and quality metadata.
- Add PostgreSQL development service and pytest import configuration.
- Update gameplay documentation and the quart_common submodule revision.
2026-08-01 16:21:02 +02:00
daniel156161 ce3f9f1d82 rework that the sqlite and postgresql backend uses the same code to build the data for the dashboard 2026-08-01 11:58:49 +02:00
daniel156161 341bb27278 change that GameplayDatabase can have different backends, sqlite and postgresql with a Template example backend 2026-04-08 14:28:39 +02:00
daniel156161 f479541c04 remove : space between function args 2026-04-07 12:02:50 +02:00
daniel156161 5c1875be60 move imports that longst is ontop 2026-04-06 19:02:04 +02:00
daniel156161 7c990f98fc disable GameplayDatabase compression by default
Build and Push Docker Container / build-and-push (push) Successful in 4m19s
2026-04-06 18:30:11 +02:00
daniel156161 0af5f58688 fix loading of storage and not crash the request 2026-04-06 17:59:10 +02:00
daniel156161 ed41c32ad8 don't crash server when sqlite-zstd extension can't be loaded
Build and Push Docker Container / build-and-push (push) Successful in 3m58s
2026-04-06 17:22:27 +02:00
daniel156161 1a1bcd8ec3 move ensure auto vacuum full when init database or change to full when already exists 2026-04-06 16:35:05 +02:00
daniel156161 fe999c11f4 add compression to GameplayDatabase and test if compression works with the sqlite_zstd extension 2026-04-06 16:34:15 +02:00
daniel156161 01343472df move all Databases into the database folder to not have storeage and Database when they are all Databases 2026-04-06 16:24:28 +02:00
daniel156161 097a7f295a update dashboards over websocket and remove database path from GameplayDatabase output
Build and Push Docker Container / build-and-push (push) Failing after 13m18s
2026-04-06 01:49:26 +02:00
daniel156161 4626a491f5 update Dashboard with new keyboard bindings fix errors with hazards, set win or loss on stale games (older) and push new games real time over the websocket connection when they are finished
Build and Push Docker Container / build-and-push (push) Failing after 12m39s
2026-04-06 00:36:06 +02:00
daniel156161 b7c6a0e345 fix svg color problem show dead resions when very sure and allow to highlight snakes when clicking into them store timout and calcumate Snake Win Rate Overall, fix to use full page of games-body, get win lloss or unknown 2026-04-05 23:01:27 +02:00
daniel156161 2d603a3b0b add better dashboard with full snake game board 2026-04-05 19:57:43 +02:00
daniel156161 4151810f1b add GameplayDatabase database with dashboard 2026-04-05 16:48:12 +02:00