Skip to content

BUILD-548: validate levels requested with world_build --lod-sets - #1965

Merged
ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
FreddyxS:fix/world-lod-set-levels
Nov 22, 2026
Merged

ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
FreddyxS:fix/world-lod-set-levels

Conversation

@FreddyxS

Copy link
Copy Markdown
Contributor

BUILD-548 claim in #1902.

Depends on: #1316 (LOD chunk sets).

What changed

--lod-levels accepts byte values. With --lod-sets, only levels 0 through 6 have chunk tiers, so selecting level 7 raises KeyError during chunk naming and level 255 overflows the signed tier array. Reject unrecognized tiers before generating output and document the supported range in --help. Placement filtering without --lod-sets still accepts the full byte range.

Verified

  • On Windows with Python 3.13.15, both new CLI subtests raise on main (6a6704df) and pass with the fix. Each case returns 1 with a specific diagnostic and creates no output directory. With LOD sets disabled, both synthetic placements still export.
  • The instancing, placement, world-build, world JSON atomicity and GLB writer suites ran 159 tests. 158 passed and the POSIX permission test was skipped on Windows.
  • compileall, world_build.py --help, git diff --check and the merge check against main passed. The published branch tree matches the locally tested tree.

Synthetic inputs and CPU tests. AI-assisted (Codex).

@lucastayaralvarenga-ui lucastayaralvarenga-ui left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review · #1965

Branch fix/world-lod-set-levels · Author FreddyxS · Open and mergeable · Commit dbd53921

What changes

--lod-sets now checks the requested levels against the chunk tier table before creating output. A separate placement test confirms that levels 7 and 255 still export with placement filtering alone. Validation · CLI and placement regressions

Verification

  • On main (4eb6155d), level 7 raised KeyError and level 255 raised OverflowError in the CLI regression.
  • The instancing, placement and world-build suites passed with 104 tests and 148 subtests.
  • Windows 11 Pro, Python 3.12.16, CPU only with synthetic inputs. git diff --check passed. GitHub checks were queued at review time.

Recommendation

Approve. The 0–6 constraint is applied where named chunk tiers are required.

AI-assisted review with Codex.

@undeadhuman37

Copy link
Copy Markdown
Contributor

Tested dbd5392 merged into main 6a6704d (clean merge) on macOS (Apple Silicon, APFS, Python 3.12.10, pytest 9.2.0, CPU only): pass.

  • python -m compileall -q make_game.py tools tests: OK.
  • The PR's tests with pytest: 26 passed, 2 subtests passed in 0.28s.
  • Negative control: the PR's test files run against main's code give 2 failed, 26 passed in 0.35s, so the new tests catch what the PR changes.

AI-assisted (Claude Code), tested on a Mac.

@ItsNotRexed
ItsNotRexed merged commit 4b8f836 into ItsNotRexed:main Nov 22, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants