navmesh_links: pair cross-tile endpoint sector with polygon id and publish --out atomically (NAVMESH-LINKS-ENDPOINT-PAIRING-AND-IO) #1515
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1515"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by IlyassRS3 on 2026-11-25T03:02:47Z.
Claimed in the coordination issue as: NAVMESH-LINKS-ENDPOINT-PAIRING-AND-IO (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151504645)
What and why
verify_tile):verify_tilepreviously checkedif not ((p0 == gpi or p1 == gpi) and (s0 == c8 or s1 == c8)), decoupling each endpoint's sector ID from its polygon ID.(s1 == c8, p1 == 2)and one remote endpoint(s0 == c8 + 1, p0 == 1), if both local polygon2and spurious local polygon1listed the link in+0xB0, the check falsely passed becausep0 == 1matched the remote polygon ID whiles1 == c8matched the local sector (and the follow-upby_licheck also sawp1 == 2present).if not ((s0 == c8 and p0 == gpi) or (s1 == c8 and p1 == gpi)).scan):start >= 0andlimit >= 1(rejectingbooland invalid values) inscan()rather than only inmain().--outpublishing, strict JSON, and clean CLI error reporting (_write_json_atomic,main):--outvia a sibling temp file,file_mode.published_mode, andreplace_retry.replace, cleaning up on failure so an existing report is never truncated on error.allow_nan=Falseon both--outand stdout JSON, and catchesOSErrorinmain()to emit a singleerror:line and exit code 2 instead of a traceback.Tested
python3 -I tests/test_navmesh_links.py -v: 11/11 OK (8 existing + 3 new regression tests).main:tools/navmesh_links.py: all 3 new tests fail (FAILED (failures=9, errors=1)), including both cross-tile endpoint directions (remote_s0andremote_s1).python3 -I tests/test_text_write_line_endings.py: 3/3 OK.python3 -I scripts/check_no_game_data.py tools/navmesh_links.py tests/test_navmesh_links.py: clean.python3 -m compileall -q tools/navmesh_links.py tests/test_navmesh_links.py: clean.GPUs tested: n/a (pure Python stdlib tool, synthetic navmesh tile tests only, no GPU or game data)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — no translator rule changes)Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T03:03:01Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by ytsodacan on 2026-11-25T03:34:04Z.
[KEEP]
verify_tileintools/navmesh_links.pynow pairs each endpoint sector with its own polygon id, closing the false pass described in the PR, with three new regression tests intests/test_navmesh_links.py.change-scope,no-game-datapending), so the 11/11 local result is not yet confirmed.scan()argument validation and an atomic--outwriter with strict JSON and new CLI error handling. Maintainers may want these split or confirmed as acceptable together.scan()now raisesValueErrorforstart/limitfrom direct callers; worth checking no other caller relies on the old behavior.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T20:43:29Z.
#1515 | head
369310e6ea(merged cleanly with main1bc055e6c2) |python -I tests/test_navmesh_links.py| red on main:FAILED (failures=9, errors=1)(verify_tileaccepted cross-tile link endpoint IDs on the wrong sector,scanaccepted negative/boolstartand non-positive/boollimit, and--outlackedreplace_retryatomic publication) | green on PR+main:11 tests OK| Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/navmesh_links.pyandtests/test_navmesh_links.pyon Windows 11 NTFS, verifying paired(s0 == c8 and p0 == gpi) or (s1 == c8 and p1 == gpi)endpoint checks inverify_tile, strict integer/non-boolstartandlimitbounds inscan,_write_json_atomic(allow_nan=False+tempfile.mkstemp+replace_retrypreserving existing reports and leaving zero.tmpfiles on failure), clean exit-2OSErrorreporting,tests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T00:17:16Z.
Tested
369310e6emerged (no commit) withmain829530dbd: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.tests/test_navmesh_links.py, 11 tests pass.tools/navmesh_links.pyback tomain, 9 failures and 1 error (ValueError not raised).No blocker from my side.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T00:43:34Z.
Merged after TheGeogeo's red/green check (check) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto
maine66c65b95without conflict, and its test file(s) (tests/test_navmesh_links.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.