navmesh_cell_fit: measure the baseline across all sampled control tiles #2446

Merged
kirigayakazima merged 1 commit from upstream-pr/2446 into main 2026-11-28 19:42:31 +00:00
kirigayakazima commented 2026-11-27 10:17:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T10:17:10Z.


Claimed in the coordination issue as: NAVMESH-CONTROL-FULL-BASELINE

What and why

The reported fit count covered every sampled static tile, while its chance baseline only covered the first twenty. Compute the mean over all measurable sampled tiles, weighted by how often each horizontal extent occurs. Cache the expensive per-axis calculations and exclude tiles without a measurable axis from the mean. A regression changes the extent after tile twenty and checks the weighted result, reversed input order and the all-flat case.

Tested

Windows, Python 3.14.7, synthetic fixtures.

  • python -I tests/test_navmesh_cell_fit.py
  • Changed-path game-data scan and git diff --check passed.
  • Shared main baseline: 6,374 translator semantic tests passed across 500 files. The combined five-topic checkout passed 172 focused tests.

GPUs tested: N/A (CPU-only).

AI-assisted: Yes.

Checklist

  • Based on current main and merges cleanly with the tested base.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract table: N/A.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5524931304 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2446). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-27T10:17:10Z. --- Claimed in the coordination issue as: [NAVMESH-CONTROL-FULL-BASELINE](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7215561737) ### What and why The reported fit count covered every sampled static tile, while its chance baseline only covered the first twenty. Compute the mean over all measurable sampled tiles, weighted by how often each horizontal extent occurs. Cache the expensive per-axis calculations and exclude tiles without a measurable axis from the mean. A regression changes the extent after tile twenty and checks the weighted result, reversed input order and the all-flat case. ### Tested Windows, Python 3.14.7, synthetic fixtures. - `python -I tests/test_navmesh_cell_fit.py` - Changed-path game-data scan and `git diff --check` passed. - Shared main baseline: 6,374 translator semantic tests passed across 500 files. The combined five-topic checkout passed 172 focused tests. GPUs tested: N/A (CPU-only). AI-assisted: Yes. ### Checklist - [x] Based on current main and merges cleanly with the tested base. - [x] One topic. - [x] No game data, keys or decryption. - Translator contract table: N/A.
MSedgeMC commented 2026-11-27 15:07:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-27T15:07:40Z.

Review: COMMENTED


Verified on the PR branch: python3 -m unittest tests.test_navmesh_cell_fit -v -> 5 tests OK, including the new documented-baseline cases. Not approving yet: the branch is 606 commits behind current main, so a rebase is needed before reviewing the final diff.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6090121540 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2446#pullrequestreview-6090121540). Originally posted by [MSedgeMC](https://github.com/MSedgeMC) on 2026-11-27T15:07:40Z. **Review:** COMMENTED --- Verified on the PR branch: python3 -m unittest tests.test_navmesh_cell_fit -v -> 5 tests OK, including the new documented-baseline cases. Not approving yet: the branch is 606 commits behind current main, so a rebase is needed before reviewing the final diff.
zmasi commented 2026-11-28 03:13:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T03:13:41Z.


#2446 | head aaabf497be (merged cleanly with main 02f71ccfe) | python -I tests/test_navmesh_cell_fit.py | red on main: FAILED (failures=1) in 5 tests (baseline_mean 0.25 vs expected 0.2619) | green on PR+main: Ran 5 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Diff reviewed across both touched files (summarise_control weights horizontal-extent frequencies across all measurable sampled tiles via Counter + lru_cache, excludes zero-extent flat tiles, and git merge origin/main at 02f71ccfe applies cleanly with zero conflicts). Also verified on merged PR+main: python -I tests/test_runner_calls_all_tests.py (3/3 OK), python -I tests/test_text_write_line_endings.py (3/3 OK), git diff --check, and scripts/check_no_game_data.py (clean).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232900293 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2446#issuecomment-7232900293). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T03:13:41Z. --- #2446 | head aaabf497bee996b60375a12d4db10ce702fa6d41 (merged cleanly with main 02f71ccfe) | `python -I tests/test_navmesh_cell_fit.py` | red on main: FAILED (failures=1) in 5 tests (`baseline_mean` 0.25 vs expected 0.2619) | green on PR+main: Ran 5 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes Diff reviewed across both touched files (`summarise_control` weights horizontal-extent frequencies across all measurable sampled tiles via `Counter` + `lru_cache`, excludes zero-extent flat tiles, and `git merge origin/main` at `02f71ccfe` applies cleanly with zero conflicts). Also verified on merged `PR+main`: `python -I tests/test_runner_calls_all_tests.py` (3/3 OK), `python -I tests/test_text_write_line_endings.py` (3/3 OK), `git diff --check`, and `scripts/check_no_game_data.py` (clean).
MoonEyes commented 2026-11-28 19:42:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:42:28Z.


Red/green: tests/test_navmesh_cell_fit.py fails 1 assertion on main (the control baseline mean only uses the first 20 tiles) and passes with the PR (cloud run on main 7daa4a4).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7244745437 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2446#issuecomment-7244745437). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T19:42:28Z. --- Red/green: tests/test_navmesh_cell_fit.py fails 1 assertion on main (the control baseline mean only uses the first 20 tiles) and passes with the PR (cloud run on main 7daa4a4). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2446
No description provided.