world_archetypes: fix identity-quaternion/nameless-def/schema bugs, folder-input guard, and atomic I/O (WORLD-ARCHETYPES-EXTENTS-AND-IO) #1555
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1555
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/world-archetypes-extents-and-io"
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 successfully merged and closed
What
Fix four extents/schema/indexing bugs and harden CLI guards and JSON output in
tools/world_archetypes.py:(0, 0, 0, -1)/ unnormalized(0, 0, 0, k)/ zero counted as rotated (check_extents):_rotation(q, ...)normalizesqand maps bothqand-q(and(0, 0, 0, 0)) to the 3×3 identity matrix, yet line 210 checked[round(c, 6) for c in e["rotation"]] != [0, 0, 0, 1], misclassifying identity entities withw = -1as rotated and skewingrotation["maps"]and match counts._is_rotated(q)normalizingqand checkingmax(abs(x/n), abs(y/n), abs(z/n)) > 1e-6.defs[None]and matched nameless entities (run,check_extents):name,defs[None] = dinflatedsummary["names"], compared unrelated nameless boxes fornames_with_differing_boxes, and allowed an entity witharchetype: Noneto matchdefs[None]incheck_extents().defsindexing whend.get("name") is Noneand rejecte.get("archetype") is Noneincheck_extents().schema):len(b) < 0x50and stop struct/block iteration wheno + 32 > noro + 16 > ninstead of reading out-of-range0s fromWI._u32/_u64.main):--start < 0,--limit < 1, and empty/whitespace--outviaap.error(...).pathis a folder of carved files, check--outagainst every input file insidepath(WI._directory_files(a.path)+same_report_path) so--out <folder>/a.bincannot overwrite a carved input.(OSError, ValueError)fromrun()cleanly viaap.error(...)(exit 2, no traceback).--outatomically through a sibling temp file (newline="\n", trailing"\n",file_mode.published_mode,replace_retry.replace).Claimed in the coordination issue as
WORLD-ARCHETYPES-EXTENTS-AND-IO— verified 0 open PRs and 0 prior claims; unable to post a comment on#14because GitHub disabled commenting once#14reached its 2,500-comment cap (and no successor"Coordinating who works on what"issue is open yet).Testing
python3 -I -W error tests/test_world_archetypes.py -v: 23/23 OK (including 4 new regression tests).python3 -I tests/test_text_write_line_endings.py: 3/3 OK.python3 -I scripts/check_no_game_data.py tools/world_archetypes.py tests/test_world_archetypes.py: clean.python3 -m compileall -q tools/world_archetypes.py tests/test_world_archetypes.py: clean.Mutation check against unpatched
main:tools/world_archetypes.py: all 4 new tests (13 assertions/subtests) fail onmain(FAILED (failures=13)).AI-assisted: yes
GPUs tested: none (CPU-only 0x7a archetype/extents tests on macOS; no GPU or game files needed)
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 19 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)