mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #1555] world_archetypes: fix identity-quaternion/nameless-def/schema bugs, folder-input guard, and atomic I/O (WORLD-ARCHETYPES-EXTENTS-AND-IO) #1582
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#1582
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/1555
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/world-archetypes-extents-and-io📝 Commits (1)
894044fworld_archetypes: fix identity-quaternion/nameless-def/schema bugs, folder-input guard, and atomic I/O📊 Changes
2 files changed (+146 additions, -13 deletions)
View changed files
📝
tests/test_world_archetypes.py(+74 -0)📝
tools/world_archetypes.py(+72 -13)📄 Description
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)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.