world_grid_atlas: diagnose one-cell shoreline grids #455

Manually merged
github merged 1 commit from gh-pr/455/head into gh-pr/455/base 2026-11-26 09:01:12 +00:00
Owner

@⁠EdenBendheim on GitHub · 2026-11-24 05:42 UTC · original
EdenBendheim:ubiq/world-grid-atlas-one-cell-mask → main · +55 −7 · 2 files · 1 commits · merged 2026-11-24 06:57 UTC

Claim: #14

What changed

  • tools/world_grid_atlas.py: Validate grid["rows"] * grid["columns"] < 2 at the top of match_mask() before reading the fallback or ranking a runner-up score, raising the same descriptive ValueError (a grid needs at least two cells to rank a match) used by match_content() so the CLI exits 2 cleanly instead of IndexError.
  • tests/test_world_grid_atlas.py: Synthetic tests covering 1×1, 0-row, and 0-column grids, a real CLI run on a synthetic BGRA fixture, and a valid two-cell match (plus LF fixture writes pinned).

Testing & Disclosure

  • AI-assisted: Implemented with Codex (gpt-6.2-sol) and reviewed with Codex (gpt-6.2-astra).
  • Environment: macOS 27.3, Apple M1 Max (CPU-only, synthetic fixtures, zero game data).
  • Verified on ubiquitarianism/leonida main (8f481cf16): test_world_grid_atlas.py (19 passed, 13 skipped without Pillow; previously verified 32/32 with NumPy 2.3.1 + Pillow 13.0.0), check_no_game_data.py, LF check — all passed.
**@⁠EdenBendheim** on GitHub · 2026-11-24 05:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/455) `EdenBendheim:ubiq/world-grid-atlas-one-cell-mask` → `main` · +55 −7 · 2 files · 1 commits · merged 2026-11-24 06:57 UTC Claim: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ### What changed - **`tools/world_grid_atlas.py`**: Validate `grid["rows"] * grid["columns"] < 2` at the top of `match_mask()` before reading the fallback or ranking a runner-up score, raising the same descriptive `ValueError` (`a grid needs at least two cells to rank a match`) used by `match_content()` so the CLI exits `2` cleanly instead of `IndexError`. - **`tests/test_world_grid_atlas.py`**: Synthetic tests covering 1×1, 0-row, and 0-column grids, a real CLI run on a synthetic BGRA fixture, and a valid two-cell match (plus LF fixture writes pinned). ### Testing & Disclosure - **AI-assisted:** Implemented with Codex (`gpt-6.2-sol`) and reviewed with Codex (`gpt-6.2-astra`). - **Environment:** macOS 27.3, Apple M1 Max (CPU-only, synthetic fixtures, zero game data). - **Verified on `ubiquitarianism/leonida` `main` (`8f481cf16`):** `test_world_grid_atlas.py` (19 passed, 13 skipped without Pillow; previously verified 32/32 with NumPy 2.3.1 + Pillow 13.0.0), `check_no_game_data.py`, LF check — all passed.
Mask matching ranks the best and runner-up overlaps, so a single cell has no second score. Reject grids with fewer than two cells using the same error as content matching.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:01:09 +00:00
github manually merged commit c33f9d6e8d into gh-pr/455/base 2026-11-26 09:01:12 +00:00
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 06:57 UTC · original

Merging. Why merged: a one-cell shoreline grid now stops with a one-line error instead of producing a meaningless match.
Why it's good: security-reviewed; tested on Windows 11 merged onto main c023a36: test_world_grid_atlas 29 -> 32 tests, all OK (the new tests fail on main: 3 failures, 1 error); the native tests still pass.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 06:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/455#issuecomment-7124469205) Merging. Why merged: a one-cell shoreline grid now stops with a one-line error instead of producing a meaningless match. Why it's good: security-reviewed; tested on Windows 11 merged onto main c023a36: test_world_grid_atlas 29 -> 32 tests, all OK (the new tests fail on main: 3 failures, 1 error); the native tests still pass. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.