mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:10:51 +01:00
[PR #1689] world_atlas_accel: validate inputs, contiguous packed_cells, and native output bounds/finiteness #1703
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1703
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1689
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/world-atlas-accel-bounds-and-fallback📝 Commits (1)
f5ef8d0world_atlas_accel: validate inputs, contiguous packed_cells, and native output bounds/finiteness📊 Changes
2 files changed (+71 additions, -5 deletions)
View changed files
📝
tests/test_world_grid_atlas_native.py(+53 -0)📝
tools/world_atlas_accel.py(+18 -5)📄 Description
Item ID:
WORLD-ATLAS-ACCEL-BOUNDS-AND-FALLBACK(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156815392)Summary
tools/world_atlas_accel.py):cells, non-finite orboolmargin, and invalidordersequences (wrong length, out-of-range/negative indices, orboolentries) by returningNonebefore loading or invoking the native library.packed_cellsis C-contiguous and aligned vianp.require(_pack(np, cells)[order], requirements=("C", "A"))before passing its raw pointer toctypes.order[row.clear]/order[row.placed], validate thatrow.clearandrow.placedare-1or in0 .. len(order)-1, and thatrow.overlapis finite wheneverrow.placed >= 0, falling back cleanly (return None) to the Python reference instead of crashing withIndexErroror propagating corrupt indices /NaNoverlaps.tests/test_world_grid_atlas_native.py):margin/orderinputs (verifying_load()is never called) and corrupt native output rows (clear/placedout-of-bounds or< -1, non-finiteoverlap, and end-to-endmatch_mask()fallback).Checklist & Verification
python3 -I scripts/check_no_game_data.py tools/world_atlas_accel.py tests/test_world_grid_atlas_native.pypassed)python3 -W error -I tests/test_world_grid_atlas_native.py -v:Ran 9 tests ... OK (skipped=4)FallbackTestagainst unpatchedmaintools/world_atlas_accel.py):Ran 5 tests ... FAILED (failures=11, errors=3)python3 -m compileall -q make_game.py tools tests: passedpython3 -I tests/test_text_write_line_endings.py:Ran 3 tests ... OK🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.